feat(payment): PAYPAL-6352 implemented server side shipping callbacks logic#3237
Conversation
a2ec8bf to
a04ab51
Compare
0107bfd to
3672197
Compare
|
|
||
| if (this.paypalButton.hasReturned?.() && this.isAppSwitchEnabled(methodId)) { | ||
| if ( | ||
| this.paypalButton.hasReturned?.() && |
There was a problem hiding this comment.
As you mentioned before hasReturned should be removed since we do not need it anymore. Is there a reason to leave it as it is here?
There was a problem hiding this comment.
yes, i did not change this PR yet
| const quoteShippingAddress = consignment.shippingAddress; | ||
| shippingAddress = { | ||
| ...quoteShippingAddress, | ||
| ...this.bigCommercePaymentsIntegrationService.getShippingAddressFromOrderDetails( |
There was a problem hiding this comment.
Was this part aligned with the back-end part of work? I remember we discussed it and it is something you need to clarify with @alstarodubtcev
3672197 to
421dc35
Compare
421dc35 to
a6d4f1c
Compare
a6d4f1c to
ce4cb7a
Compare
9519e8a to
043080c
Compare
043080c to
5862f51
Compare
| shouldRunAcceleratedCheckout?: boolean; | ||
| paymentButtonStyles?: Record<string, PayPalButtonStyleOptions>; | ||
| isAppSwitchEnabled?: boolean; | ||
| isServerSideShippingCallbacksEnabled?: boolean; |
There was a problem hiding this comment.
Dead hasReturned and resume type members after removal
Low Severity
The hasReturned and resume optional methods on the BigCommercePaymentsButtons interface are now dead code. This PR removed every call site for both methods (from the button, customer, and payment strategies), but the type definitions remain. The reviewer already flagged hasReturned specifically. Keeping unused members in an SDK interface can mislead future developers into thinking these are still part of the integration contract.
Reviewed by Cursor Bugbot for commit 5862f51. Configure here.
dc2209e to
34116fa
Compare
| } | ||
|
|
||
| async updateOrder(): Promise<void> { | ||
| async updateOrder(isServerSideShippingCallbacksEnabled?: boolean): Promise<void> { |
There was a problem hiding this comment.
It would be better and safer to add a test for this new logic
34116fa to
e91b628
Compare
e91b628 to
18d901a
Compare
5a4af00 to
3d92bc5
Compare
669bbc3 to
03f6932
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 03f6932. Configure here.
03f6932 to
ad70400
Compare


What/Why?
Implemented server side shipping callbacks logic for BCP
Rollout/Rollback
Revert PR
Testing
Unit tests
Note
Medium Risk
Changes the PayPal hosted-checkout approval and order-update flow, conditionally skipping client-side shipping callbacks and altering the
updateOrderpayload; mistakes could impact shipping selection/address syncing and order submission timing.Overview
Adds a new
isServerSideShippingCallbacksEnabledflag to BigCommerce Payments initialization data and wires it through PayPal button/customer hosted-checkout flows.When enabled, the strategies stop registering PayPal
onShippingAddressChange/onShippingOptionsChangecallbacks, adjust the approve path to avoidactions.order.get()/address updates, force anupdateOrdercall with empty shipping options +selectedShippingOption: null, and reload checkout before submitting order/payment. App-switch rendering/resume logic (and related tests/mocks) is removed, andPayPalUpdateOrderRequestBody.selectedShippingOptionnow allowsnull.Reviewed by Cursor Bugbot for commit ad70400. Bugbot is set up for automated code reviews on this repo. Configure here.