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

Use payment_source + experience_context #1491

Draft
wants to merge 11 commits into
base: trunk
Choose a base branch
from

Conversation

AlexP11223
Copy link
Contributor

@AlexP11223 AlexP11223 commented Jul 5, 2023

Replacing the deprecated application_context fields with payment_source + experience_context. https://developer.paypal.com/docs/api/orders/v2/#orders_create

Affects mainly the orders created via CreateOrderEndpoint.
Oxxo remains unchanged: not sure if it needs such context for order creation (and in /confirm-payment-source it is not deprecated).
PUI does not seem to use application_context too.
We set application_context.stored_payment_source here for subscriptions, it is ok because this field was not deprecated.
And for now keeping the old format for ACDC because it's unclear how to create payment_source for it.

Also added PAYER_ACTION_REQUIRED in the list of order statuses because it seems to be created with this status now (but it does not affect anything). And now allowing both 200 and 201 HTTP status codes, it supposed to be 200 according to the docs but it was 201 when using old format.

For the existing plugin installations continuing to use the old format with application_context to avoid breaking filters like ppcp_create_order_request_body_data. This can be overridden via ppcp_flag_old_application_context filter or PPCP_FLAG_OLD_APPLICATION_CONTEXT=0 (or 1) env var.

@AlexP11223 AlexP11223 force-pushed the PCP-1801-experience-context branch from d7ff72e to 7bb4112 Compare July 5, 2023 14:22
@@ -18,7 +18,7 @@
use WooCommerce\PayPalCommerce\ApiClient\Entity\OrderStatus;
use WooCommerce\PayPalCommerce\ApiClient\Entity\PatchCollection;
use WooCommerce\PayPalCommerce\ApiClient\Entity\Payer;
use WooCommerce\PayPalCommerce\ApiClient\Entity\PaymentMethod;
use WooCommerce\PayPalCommerce\ApiClient\Entity\PaymentSource;
use WooCommerce\PayPalCommerce\ApiClient\Entity\PaymentToken;
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems PaymentToken not needed here.

@AlexP11223 AlexP11223 marked this pull request as draft July 11, 2023 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants