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

Update PayPal component to add the onShippingChange event. #710

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

pabloai
Copy link
Contributor

@pabloai pabloai commented Feb 1, 2021

Summary

Update PayPal component to add the onShippingChange event. This lets merchants listen to shipping changes and accept or reject the selected address.

More information on PayPal's docs and (JavaScript SDK references](https://developer.paypal.com/docs/business/javascript-sdk/javascript-sdk-reference/#onshippingchange).

const paypalComponent = checkout.create('paypal', {
    // ...
    onShippingChange: (data, actions) => {
        if (data.shipping_address.country_code !== 'US') {
            return actions.reject();
        }

        return actions.resolve();
    }
}

Keep in mind that updating the order is not supported in our implementation, so it's not possible to patch the amount according to the selected address.

Fixed issue: #700

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2021

Size Change: +11 B (0%)

Total Size: 145 kB

Filename Size Change
packages/lib/dist/adyen.js 145 kB +11 B (0%)

compressed-size-action

@sonarcloud
Copy link

sonarcloud bot commented Feb 1, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@pabloai pabloai merged commit 94c612f into master Feb 1, 2021
@pabloai pabloai deleted the feature/paypal-shipping-change branch February 1, 2021 14:23
@marcperez marcperez mentioned this pull request Feb 1, 2021
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