mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Use shipping callback
This commit is contained in:
parent
b16ef8e333
commit
6691ee5a21
5 changed files with 44 additions and 12 deletions
|
@ -446,12 +446,15 @@ class CreateOrderEndpoint implements EndpointInterface {
|
|||
$payment_source_key = $funding_source;
|
||||
}
|
||||
|
||||
$experience_context = $this->experience_context_builder->with_default_paypal_config( $shipping_preference, $action );
|
||||
if ( $shipping_preference === ExperienceContext::SHIPPING_PREFERENCE_GET_FROM_FILE ) {
|
||||
$experience_context = $experience_context->with_shipping_callback();
|
||||
}
|
||||
|
||||
$payment_source = new PaymentSource(
|
||||
$payment_source_key,
|
||||
(object) array(
|
||||
'experience_context' => $this->experience_context_builder
|
||||
->with_default_paypal_config( $shipping_preference, $action )
|
||||
->build()->to_array(),
|
||||
'experience_context' => $experience_context->build()->to_array(),
|
||||
)
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue