@storecraft/payments-paypal
v1.3.0
Published
Official Paypal integration with Storecraft
Maintainers
Readme
Paypal payment gateway for StoreCraft
paypal integration
Features
- Create checkouts with
AUTHORIZEorCAPTUREintents capture,void,refundactions- Get a readable and explainable
status - Supports both
prodandtestendpoints
npm i @storecraft/payments-paypalHowto
import { PayPal, Config } from '@storecraft/payments-paypal';
const config: Config = {
env: 'prod',
client_id: process.env.PAYPAL_CLIENT_ID,
secret: env.process.PAYPAL_SECRET,
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() // config can be inferred from env variables
}).init();
Developer info and test
Integration examples
Credit Card Generator
todo:
- Add tests
- Add webhook support
Author: Tomer Shalev ([email protected])