https://github.com/vectormike/payment-module
Payment module for Braintree, Paypal, Stripe and more
https://github.com/vectormike/payment-module
Last synced: 10 months ago
JSON representation
Payment module for Braintree, Paypal, Stripe and more
- Host: GitHub
- URL: https://github.com/vectormike/payment-module
- Owner: Vectormike
- Created: 2022-05-19T17:23:00.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-15T08:16:50.000Z (almost 4 years ago)
- Last Synced: 2025-03-28T05:43:05.950Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 1.38 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Usage
```js
const PaymentServices = require('47-billion-payments');
const paymentServices = new PaymentServices({
secretKey: process.env.SECRET_KEY,
publicKey: process.env.PUBLIC_KEY,
sandbox: true, // For sandbox mode defaults to false
});
try {
const res = await paymentServices.braintree.createPayment({ amount: '500', creditCard: { expirationDate: '', number: '' } });
if (res.status === 200) {
// Successful
}
} catch (err) {
if (!err.response) {
// No response from the server
// Bad network
} else {
// Response was returned from the server
// ...
}
}
```