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

[Feature] Add Paypal Donate SDK inplemetation #570

Open
Vladi-ed opened this issue Oct 13, 2024 · 0 comments
Open

[Feature] Add Paypal Donate SDK inplemetation #570

Vladi-ed opened this issue Oct 13, 2024 · 0 comments

Comments

@Vladi-ed
Copy link

🚀 Feature Proposal

There is no Donate SDK implementation in @paypal/paypal-js

Motivation

I just want to gather donation in my SPA but there is no implementation i can find inside @paypal/paypal-js

Example

Example for how this feature would be used:

import { loadDonationScript } from "@paypal/paypal-js";

let paypal;

try {
    paypal = await loadDonationScript();
} catch (error) {
    console.error("failed to load the PayPal JS SDK script", error);
}

if (paypal) {
    try {
        await paypal.DonateButton({
          env: 'production',
          hosted_button_id: '123',
          image: {
            src: 'assets/donate.png',
            alt: 'Donate',
            title: 'Support my work',
          }
      } ).render("#your-container-element");
    } catch (error) {
        console.error("failed to render the PayPal Buttons", error);
    }
}
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

No branches or pull requests

1 participant