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

WooPay compatibility with deferred intent creation UPE #6656

Merged
merged 23 commits into from
Jul 18, 2023
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3fc3f2a
Shortcode checkout compatibility between WooPay and card payment meth…
Jul 3, 2023
f57c096
Use proper Stripe account depending on payment method on shortcode ch…
Jul 9, 2023
e88a2bd
Support WooPay with deferred intent UPE on Blocks checkout
Jul 9, 2023
920d49f
Ensure backwards compatibility of payment processing for legacy card
Jul 10, 2023
f27e823
Merge branch 'develop' into feature/deferred-intent-woopay
Jul 10, 2023
3058aea
Add changelog entry
Jul 10, 2023
076fc4a
Fix unit tests for split UPE
Jul 10, 2023
61050c0
Extend payment information with Stripe ID of payment method and fix c…
Jul 10, 2023
d645802
Merge branch 'develop' into feature/deferred-intent-woopay
Jul 10, 2023
e0f03bd
Fix JS unit tests
Jul 10, 2023
783accf
Simplify the interface of the stripe object helper function
Jul 10, 2023
8513b0e
Add function description
Jul 10, 2023
1c33980
Clarify payment_information logic and avoid magic numbers
Jul 10, 2023
de89d1f
Simplify gateway registration logic by removing unnecessary branching
Jul 10, 2023
cf6b0de
Merge branch 'develop' into feature/deferred-intent-woopay
Jul 10, 2023
eb5876d
Merge branch 'develop' into feature/deferred-intent-woopay
timur27 Jul 11, 2023
8991d36
Improve Stripe platform account logic
Jul 12, 2023
3fc9362
Merge branch 'develop' into feature/deferred-intent-woopay-1
Jul 12, 2023
d0fcfac
Merge branch 'develop' into feature/deferred-intent-woopay
timur27 Jul 13, 2023
cfec6e8
Support WC Subscription renewals with deferred intent creation UPE
Jul 14, 2023
9243b62
Merge branch 'develop' into feature/deferred-intent-woopay
Jul 17, 2023
119067a
Merge branch 'develop' into feature/deferred-intent-woopay
Jul 17, 2023
3af7500
Provide payment method Stripe ID while adding a new payment method
Jul 17, 2023
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
Prev Previous commit
Next Next commit
Support WooPay with deferred intent UPE on Blocks checkout
Timur Karimov committed Jul 9, 2023
commit e88a2bd124212386c7cbdeede506a3be6d4e1235
Original file line number Diff line number Diff line change
@@ -10,7 +10,10 @@ import { useEffect, useState } from 'react';
import PaymentProcessor from './payment-processor';

const PaymentElements = ( { api, ...props } ) => {
const stripe = api.getStripe();
const stripe = api.getStripeForUPE(
getUPEConfig( 'paymentMethodsConfig' )[ props.paymentMethodId ]
.forceNetworkSavedCards
);
const [ errorMessage, setErrorMessage ] = useState( null );
const [ appearance, setAppearance ] = useState(
getUPEConfig( 'wcBlocksUPEAppearance' )
Original file line number Diff line number Diff line change
@@ -115,7 +115,11 @@ const PaymentProcessor = ( {
await validateElements( elements );

const paymentMethodObject = await api
.getStripe()
.getStripeForUPE(
getUPEConfig( 'paymentMethodsConfig' )[
paymentMethodId
].forceNetworkSavedCards
)
.createPaymentMethod( {
elements,
params: {
7 changes: 6 additions & 1 deletion client/checkout/blocks/upe-split.js
Original file line number Diff line number Diff line change
@@ -63,6 +63,7 @@ const api = new WCPayAPI(
locale: getUPEConfig( 'locale' ),
isUPEEnabled: getUPEConfig( 'isUPEEnabled' ),
isUPESplitEnabled: getUPEConfig( 'isUPESplitEnabled' ),
isUPEDeferredEnabled: getUPEConfig( 'isUPEDeferredEnabled' ),
isStripeLinkEnabled,
},
request
@@ -99,7 +100,11 @@ Object.entries( enabledPaymentMethodsConfig )
upeConfig.testingInstructions
),
savedTokenComponent: <SavedTokenHandler api={ api } />,
canMakePayment: () => !! api.getStripe(),
canMakePayment: () =>
!! api.getStripeForUPE(
getUPEConfig( 'paymentMethodsConfig' )[ upeName ]
.forceNetworkSavedCards
),
paymentMethodId: upeMethods[ upeName ],
// see .wc-block-checkout__payment-method styles in blocks/style.scss
label: (