mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Fix subscription initial payment method name
This commit is contained in:
parent
9f859da8cb
commit
8266e1bce7
2 changed files with 11 additions and 2 deletions
|
@ -326,8 +326,6 @@ const PayPalComponent = ({
|
|||
};
|
||||
|
||||
handleSubscriptionShippingChange = async (data, actions) => {
|
||||
console.log('--- handleSubscriptionShippingChange', data, actions);
|
||||
|
||||
try {
|
||||
const shippingOptionId = data.selected_shipping_option?.id;
|
||||
if (shippingOptionId) {
|
||||
|
|
|
@ -111,6 +111,17 @@ class WcSubscriptionsModule implements ModuleInterface {
|
|||
$subscription->update_meta_data( 'ppcp_previous_transaction_reference', $transaction_id );
|
||||
$subscription->save();
|
||||
}
|
||||
|
||||
// Update the initial payment method title if not the same as the first order.
|
||||
$payment_method_title = $parent_order->get_payment_method_title();
|
||||
if (
|
||||
$payment_method_title
|
||||
&& $subscription instanceof \WC_Subscription
|
||||
&& $subscription->get_payment_method_title() !== $payment_method_title
|
||||
) {
|
||||
$subscription->set_payment_method_title( $payment_method_title );
|
||||
$subscription->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue