Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating ECE to shortcode checkout #3436

Merged
merged 131 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
7d1d4b7
add ece feature flag
Mayisha Sep 2, 2024
a5cc1f0
update '@stripe/react-stripe-js' to latest
Mayisha Sep 3, 2024
26c0196
render ece button on block checkout
Mayisha Sep 3, 2024
fe572d5
display ece button if feature flag is enabled
Mayisha Sep 4, 2024
48e7e11
Merge branch 'develop' into task/3402-ece-ff
Mayisha Sep 9, 2024
122db02
check ece feature flag status from blocks data
Mayisha Sep 9, 2024
6a8e7ae
add min height to express checkout container
Mayisha Sep 9, 2024
34dc409
create 'WC_Stripe_Express_Checkout_Element' class
Mayisha Sep 10, 2024
ac13e24
fix callback function name
Mayisha Sep 10, 2024
0da1b05
register script for shortcode checkout
Mayisha Sep 10, 2024
9291021
move ajax functions to separate class
Mayisha Sep 10, 2024
8c6f05d
move helper functions to a separate class
Mayisha Sep 10, 2024
e3f68d3
include and initialize express checkout classes
Mayisha Sep 10, 2024
9502a5a
Merge branch 'develop' into task/ece-backend
Mayisha Sep 10, 2024
55e661c
make functions public in the helper class
Mayisha Sep 11, 2024
08c3205
fix lint issue
Mayisha Sep 11, 2024
7539f73
Merge branch 'develop' into task/ece-backend
Mayisha Sep 11, 2024
1f42347
use correct global variable
Mayisha Sep 11, 2024
632b63c
fix php lint issues
Mayisha Sep 11, 2024
1be4921
Integrating ECE to shortcode checkout
wjrosa Sep 13, 2024
f2b64f3
Adding extra contraints to show ECE
wjrosa Sep 13, 2024
1e901c9
Merge branch 'develop' into add/ece-for-shortcode-checkout
wjrosa Sep 17, 2024
b318c26
Importing additional implementations from WCPay
wjrosa Sep 17, 2024
8956e8e
Use our own Stripe tracking
mattallan Sep 17, 2024
0af7c3e
Fix typos in normalizeOrderData
mattallan Sep 17, 2024
acc8e92
Add missing client/api methods to handle ECE requests
mattallan Sep 18, 2024
afbb84e
Update ESLint config to not require await directly within async funct…
mattallan Sep 18, 2024
0cd28d5
Fix JS linting issues
mattallan Sep 18, 2024
d94bde5
Use startExpressCheckoutElement() to init the payment button
james-allan Sep 18, 2024
56225b3
Add getExpressCheckoutAjaxURL util function
mattallan Sep 18, 2024
9a40a5d
Update ECE API functions to use express checkout data
mattallan Sep 18, 2024
942af31
Move api const to top and add init function for page specific initial…
james-allan Sep 18, 2024
3efecab
Fix comment
james-allan Sep 18, 2024
3a24788
Adding changelog entry
wjrosa Sep 18, 2024
c07f00d
Putting display none back
wjrosa Sep 18, 2024
8244cf3
Multiple changes to the display logic based on WCPay
wjrosa Sep 18, 2024
99cceb4
Multiple changes to the display logic based on WCPay
wjrosa Sep 18, 2024
b894df0
Fix multiple issues + changing the main element ID
wjrosa Sep 18, 2024
ef6f49d
Removing unsupported coalesce operator
wjrosa Sep 18, 2024
1114804
Including missing methods
wjrosa Sep 18, 2024
d0055ea
Fix lint issues
wjrosa Sep 18, 2024
eeee466
Fix lint issues
wjrosa Sep 18, 2024
bc581aa
Updating ESLint version and requirement
wjrosa Sep 18, 2024
e839cd0
ECE instantiation options update
wjrosa Sep 18, 2024
bd7dacd
Fix get/update shipping option AJAX requests
mattallan Sep 19, 2024
1168099
Rename WooPayment related funtion and fix camelcase issue
james-allan Sep 19, 2024
a933b6e
Fetch proper requestShipping meta from product data
mattallan Sep 19, 2024
e49eb3a
Set 'wc-stripe-is-deferred-intent' in data submitted with the checkou…
mattallan Sep 19, 2024
e36f28b
Merge branch 'develop' into add/ece-for-shortcode-checkout
wjrosa Sep 19, 2024
1e08089
Fixing additional JS error + reverting removal of ESLint rule
wjrosa Sep 20, 2024
dbee822
Resolving ESLint issues
wjrosa Sep 20, 2024
a3409f9
Increasing ECMAScript version in .jshintrc
wjrosa Sep 20, 2024
15ed41f
Reverting unnecessary changes to stripe-utils
wjrosa Sep 20, 2024
fe64a45
Reverting more unnecessary changes
wjrosa Sep 20, 2024
63ba605
Reverting hardcoded flag
wjrosa Sep 20, 2024
74df4cf
Fix Jest functions undefined in .jshintrc
wjrosa Sep 20, 2024
c0f2336
Adding specific unit tests
wjrosa Sep 20, 2024
bc7a79b
Adding specific unit tests
wjrosa Sep 20, 2024
94b9c63
Reverting unnecessary changes
wjrosa Sep 20, 2024
1554796
Putting some coalesce operators back
wjrosa Sep 20, 2024
a5b19e4
Replace i18n text domain
james-allan Sep 23, 2024
7a53b7c
Fix typo
james-allan Sep 23, 2024
5f2dba8
add tracking functions for ece
Mayisha Sep 23, 2024
98e901a
add functions for ajax calls for ece
Mayisha Sep 23, 2024
a495f3e
add event handlers for ece
Mayisha Sep 23, 2024
378dedf
add utils for ece
Mayisha Sep 23, 2024
326cb08
render ece button on block checkout
Mayisha Sep 3, 2024
ee64e67
display ece button if feature flag is enabled
Mayisha Sep 4, 2024
2ec92b4
check ece feature flag status from blocks data
Mayisha Sep 9, 2024
5224e37
create 'WC_Stripe_Express_Checkout_Element' class
Mayisha Sep 10, 2024
38f34ce
register script for shortcode checkout
Mayisha Sep 10, 2024
3014ae7
move helper functions to a separate class
Mayisha Sep 10, 2024
3d5d4a7
fix lint issue
Mayisha Sep 11, 2024
d957329
Integrating ECE to shortcode checkout
wjrosa Sep 13, 2024
a13844d
Adding extra contraints to show ECE
wjrosa Sep 13, 2024
a158ed8
Importing additional implementations from WCPay
wjrosa Sep 17, 2024
341cc7b
Use our own Stripe tracking
mattallan Sep 17, 2024
f01b77d
Fix typos in normalizeOrderData
mattallan Sep 17, 2024
01bbd19
Add missing client/api methods to handle ECE requests
mattallan Sep 18, 2024
22693c6
Update ESLint config to not require await directly within async funct…
mattallan Sep 18, 2024
1b09b4f
Use startExpressCheckoutElement() to init the payment button
james-allan Sep 18, 2024
6d71417
Add getExpressCheckoutAjaxURL util function
mattallan Sep 18, 2024
119bc54
Move api const to top and add init function for page specific initial…
james-allan Sep 18, 2024
1aa1ccb
Fix comment
james-allan Sep 18, 2024
f6f859d
Adding changelog entry
wjrosa Sep 18, 2024
41f2fe9
Putting display none back
wjrosa Sep 18, 2024
2c97fce
Multiple changes to the display logic based on WCPay
wjrosa Sep 18, 2024
7dacdee
Multiple changes to the display logic based on WCPay
wjrosa Sep 18, 2024
91da3c7
Fix multiple issues + changing the main element ID
wjrosa Sep 18, 2024
74b656b
Removing unsupported coalesce operator
wjrosa Sep 18, 2024
89022ba
Including missing methods
wjrosa Sep 18, 2024
6465a35
Fix lint issues
wjrosa Sep 18, 2024
0482754
Fix lint issues
wjrosa Sep 18, 2024
7cdca34
Updating ESLint version and requirement
wjrosa Sep 18, 2024
b84ce2f
ECE instantiation options update
wjrosa Sep 18, 2024
43270b4
Fix get/update shipping option AJAX requests
mattallan Sep 19, 2024
3e366ac
Rename WooPayment related funtion and fix camelcase issue
james-allan Sep 19, 2024
d49de74
Fetch proper requestShipping meta from product data
mattallan Sep 19, 2024
8017870
Set 'wc-stripe-is-deferred-intent' in data submitted with the checkou…
mattallan Sep 19, 2024
53534ec
Fixing additional JS error + reverting removal of ESLint rule
wjrosa Sep 20, 2024
4eb6327
Resolving ESLint issues
wjrosa Sep 20, 2024
ee6ab6f
Increasing ECMAScript version in .jshintrc
wjrosa Sep 20, 2024
af3f599
Reverting unnecessary changes to stripe-utils
wjrosa Sep 20, 2024
1a099d8
Reverting more unnecessary changes
wjrosa Sep 20, 2024
fdcaefd
Reverting hardcoded flag
wjrosa Sep 20, 2024
54c9e76
Fix Jest functions undefined in .jshintrc
wjrosa Sep 20, 2024
3c0721d
Adding specific unit tests
wjrosa Sep 20, 2024
cec24e1
Adding specific unit tests
wjrosa Sep 20, 2024
23c2a5b
Reverting unnecessary changes
wjrosa Sep 20, 2024
8f6395f
Putting some coalesce operators back
wjrosa Sep 20, 2024
f4e7700
Fix merge issues
wjrosa Sep 23, 2024
195c8c3
Merge branch 'add/ece-for-shortcode-checkout' of https://github.com/w…
wjrosa Sep 23, 2024
5466935
Fix merge issues
wjrosa Sep 23, 2024
ad9c359
Fix merge issues
wjrosa Sep 23, 2024
4f6435e
Removing duplicate files
wjrosa Sep 23, 2024
3a369da
Fix JS import
wjrosa Sep 23, 2024
1519464
Fix JS import
wjrosa Sep 23, 2024
929385b
Merge branch 'develop' into add/ece-for-shortcode-checkout
Mayisha Sep 23, 2024
fcca9fe
Merge branch 'develop' into add/ece-for-shortcode-checkout
wjrosa Sep 24, 2024
055bf94
Merge branch 'add/ece-for-shortcode-checkout' of https://github.com/w…
wjrosa Sep 24, 2024
bea0f8a
Adding the get cart details endpoint
wjrosa Sep 24, 2024
e321b5d
Using real cart data
wjrosa Sep 24, 2024
ee0f29d
Adding get cart details nonce
wjrosa Sep 24, 2024
88c41a4
Fix get cart details nonce usage
wjrosa Sep 24, 2024
9a44df9
Merge branch 'develop' into add/ece-for-shortcode-checkout
wjrosa Sep 25, 2024
eecb00a
Updating eslint-plugin-react-hooks to 4.3.0
wjrosa Sep 25, 2024
40f0a7c
Merge branch 'add/ece-for-shortcode-checkout' of https://github.com/w…
wjrosa Sep 25, 2024
4891f8f
Fix lint issues
wjrosa Sep 25, 2024
7e0e424
Fix lint issues
wjrosa Sep 25, 2024
93de0be
Fix lint issues
wjrosa Sep 25, 2024
aaf440c
Revert hardcoded flag
wjrosa Sep 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"esversion": 6,
"esversion": 11,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some research, and this actually means the minimum ECMAScript-supported version. The 11th version was introduced in June 2020, and it supports optional property chaining (which we already use in many places of the code).

"boss": true,
"curly": true,
"eqeqeq": true,
Expand All @@ -13,6 +13,9 @@

"browser": true,

"mocha": true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes undefined functions in unit tests

"jasmine": true,

"globals": {
"_": false,
"Backbone": false,
Expand Down
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*** Changelog ***

= 8.8.0 - xxxx-xx-xx =
* Add - Add support for the new Stripe Checkout Element on the shortcode checkout page.
* Dev - Introduces a new class with payment methods constants.
* Dev - Introduces a new class with currency codes constants.
* Dev - Improves the readability of the redirect URL generation code (UPE).
Expand Down
11 changes: 11 additions & 0 deletions client/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,17 @@ export default class WCStripeAPI {
);
}

/**
* Get cart items and total amount.
*
* @return {Promise} Promise for the request to the server.
*/
expressCheckoutGetCartDetails() {
return this.request( getExpressCheckoutAjaxURL( 'get_cart_details' ), {
security: getExpressCheckoutData( 'nonce' )?.get_cart_details,
} );
}

/**
* Creates order based on Express Checkout ECE payment method.
*
Expand Down
2 changes: 2 additions & 0 deletions client/blocks/express-checkout/express-checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export const ExpressCheckout = ( props ) => {

const buttonOptions = {
buttonType: {
// eslint-disable-next-line camelcase
googlePay: wc_stripe_express_checkout_params.button.type,
// eslint-disable-next-line camelcase
applePay: wc_stripe_express_checkout_params.button.type,
},
};
Expand Down
Loading
Loading