@storecraft/payments-paypal
v1.0.6
Published
Official Paypal integration with Storecraft
Downloads
113
Maintainers
Readme
Paypal payment gateway for StoreCraft
paypal integration
Features
- Create checkouts with
AUTHORIZE
orCAPTURE
intents capture
,void
,refund
actions- Get a readable and explainable
status
- Supports both
prod
andtest
endpoints
npm i @storecraft/payments-paypal
Howto
import { PayPal } from '@storecraft/payments-paypal';
const config = {
env: 'prod',
client_id: '<get-from-your-paypal-dashboard>',
secret: '<get-from-your-paypal-dashboard>',
currency_code: 'USD',
intent_on_checkout: 'AUTHORIZE'
}
new Paypal(config);
In Storecraft App
import { App } from '@storecraft/core';
import { MongoDB } from '@storecraft/database-mongodb';
import { NodePlatform } from '@storecraft/core/platform/node';
import { GoogleStorage } from '@storecraft/storage-google';
import { Paypal } from '@storecraft/payments-paypal'
const app = new App(config)
.withPlatform(new NodePlatform())
.withDatabase(new MongoDB())
.withStorage(new GoogleStorage())
.withPaymentGateways(
{
'paypal_standard_prod': new Paypal(
{
client_id: process.env.PAYPAL_CLIENT_ID,
secret: process.env.PAYPAL_SECRET,
env: 'prod'
}
),
}
);
await app.init();
Developer info and test
Integration examples
Credit Card Generator
todo:
- Add tests
- Add webhook support
Author: Tomer Shalev ([email protected])