const pay = new PayPal({
clientId: "your_client_id",
secret: "your_secret",
mode: "sandbox",
returnUrl: "https://your-return-url.com",
cancelUrl: "https://your-cancel-url.com",
});
pay.createPayment(
{ amount: "10.00", currency: "USD", description: "Payment for item" },
(error, payment) => {
if (error) {
console.error(error);
} else {
pay.getApprovalUrl(payment.id, (error, approvalUrl) => {
if (error) {
console.error(error);
} else {
console.log(approvalUrl);
}
});
}
}
);
pay.executePayment(paymentId, payerId, (error, payment) => {
if (error) {
console.error(error);
} else {
console.log(payment);
}
});
-
Notifications
You must be signed in to change notification settings - Fork 0
Trying to make complicated API's slightly easier and more readable, less mess in your own code
License
SwyftPain/EasyAPI
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Trying to make complicated API's slightly easier and more readable, less mess in your own code
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published