Integration with Stripe
What You'll Need
Backbench account - Sign Up, the personal account will always remain free to use.
Stripe Login - Create an account(www.stripe.com) and activate your account.
Prerequisites
Generating api keys: once you signup and activate your account for api keys select developers section from stripe dashboard under that select api keys and there is a toggle switch to view test data to generate your test apis.
Operation 1: Creating checkout for for Payment.
Frontend
Select +, in the upper right corner of file manager to create a html file. For example, say "stripe.html" and select CREATE or hit Enter.
Copy and paste the code module from below.
Replace your data key with publishable key from your stripe dashboard under developers.
Select save.
Dependencies
Only for nodejs. Paste following code as package.json
.
Backend
Select +, in the upper right corner to create a Module. For example, say "stripe.js" and select CREATE or hit Enter.
Copy and paste the code module from below.
Replace SECRET KEY from stripe dashboard under developers.
Select save.
Operation 2: Retrieve balance
Balance
This is an object representing your Stripe balance. You can retrieve it to see the balance currently on your Stripe account. You can also retrieve the balance history, which contains a list of transactions that contributed to the balance (charges, pay-outs, and so forth).
Retrieve balance
Retrieves the current account balance, based on the authentication that was used to make the request.
TRANSACTION ID: The ID of the desired balance transaction, as found on any API object that affects the balance.
Operation 3: List all balance history
Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first.
Operation 3: Create a charge
Charges
To charge a credit or a debit card, you create a charge object.
To charge a credit card or other payment source, you create a charge object.
Amount: A positive integer representing how much to charge. Currency: 3-letter ISO code for currency.
Other optional parameters description, receipt_email, source.
Operation 4: Retrieve a charge
Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.
Charge: The identifier of the charge to be retrieved.
Operation 5: Customers
Customer objects allow you to perform recurring charges, and to track multiple charges, that are associated with the same customer. The API allows you to create, delete, and update your customers. You can retrieve individual customers as well as a list of all your customers.
Create a customer
Creates a new customer object.
Retrieve a customer
Retrieves the details of an existing customer. You need only supply the unique customer identifier that was returned upon customer creation.
List all customers
Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.
Operation 6: Payouts
A Payout object is created when you receive funds from Stripe, or when you initiate a payout to either a bank account or debit card of a connected Stripe account. You can retrieve individual payouts, as well as list all payouts.
Create a payout
To send funds to your own bank account, you create a new payout object. Your Stripe balance must be able to cover the payout amount, or you’ll receive an “Insufficient Funds” error.
If your API key is in test mode, money won’t actually be sent, though everything else will occur as if in live mode.
Retrieve a payout
Retrieves the details of an existing payout. Supply the unique payout ID from either a payout creation request or the payout list, and Stripe will return the corresponding payout information.
Payout: The identifier of the payout to be retrieved.
List all payouts
Returns a list of existing payouts sent to third-party bank accounts or that Stripe has sent you. The payouts are returned in sorted order, with the most recently created payouts appearing first.
Operation 7: Refunds
Refunds objects allow you to refund a charge that has previously been created but not yet refunded. Funds will be refunded to the credit or debit card that was originally charged.
Create a refund
When you create a new refund, you must specify a charge on which to create it.
Creating a new refund will refund a charge that has previously been created but not yet refunded. Funds will be refunded to the credit or debit card that was originally charged.
Charge: The identifier of the charge to refund.
Retrieve a refund
Retrieves the details of an existing payout. Supply the unique payout ID from either a payout creation request or the payout list, and Stripe will return the corresponding payout information.
List all refunds
Returns a list of all refunds you’ve previously created. The refunds are returned in sorted order, with the most recent refunds appearing first. For convenience, the 10 most recent refunds are always available by default on the charge object.
Last updated