mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Show shipping methods in paypal if express without review
This commit is contained in:
parent
8efa0e6da3
commit
9d638a57e3
12 changed files with 355 additions and 16 deletions
|
@ -15,6 +15,7 @@ const PayPalComponent = ({
|
|||
eventRegistration,
|
||||
emitResponse,
|
||||
activePaymentMethod,
|
||||
shippingData,
|
||||
}) => {
|
||||
const {onPaymentSetup} = eventRegistration;
|
||||
const {responseTypes} = emitResponse;
|
||||
|
@ -129,6 +130,16 @@ const PayPalComponent = ({
|
|||
onClick();
|
||||
};
|
||||
|
||||
let handleShippingChange = null;
|
||||
if (shippingData.needsShipping && !config.finalReviewEnabled) {
|
||||
handleShippingChange = (data) => {
|
||||
console.log(data)
|
||||
|
||||
const shippingOptionId = data.selected_shipping_option.id;
|
||||
shippingData.setSelectedRates(shippingOptionId)
|
||||
};
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (activePaymentMethod !== config.id) {
|
||||
return;
|
||||
|
@ -187,6 +198,7 @@ const PayPalComponent = ({
|
|||
onError={onClose}
|
||||
createOrder={createOrder}
|
||||
onApprove={handleApprove}
|
||||
onShippingChange={handleShippingChange}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue