This topic describes how to set up your Rebilly environment and add data needed to process transactions such as products, pricing plans, customers, and orders.
To process transactions, you must have at least one payment gateway configured in your Rebilly account. If you are testing in the sandbox environment, a test payment gateway called TestProcessor is already configured. For more information, see Set up a payment gateway.
To route transactions dynamically between payment gateways based on real-time data and selected parameters, see Payment gateway routing.
Payment methods that are displayed in payment forms, such as payment cards and digital wallets, are configured when setting up a gateway account. If you are testing in the sandbox environment, configure payment methods to display in the TestProcessor gateway.
- To add a digital wallet, such as Google Payâ„¢, Apple Pay, or Samsung Pay, as a payment method, see Set up digital wallets.
- To add other payment methods, such as ACH, PayPal, and more, see Set up a payment gateway.
To learn how to configure payment methods in forms, such as display order and location-based display, see Configure payment methods in forms.
To process payouts, you must have an active payment gateway with payout settings configured. This process describes how to activate the ready to payout instruction on the TestProcessor payment gateway in the sandbox environment.
The TestProcessor payment gateway is automatically configured in the sandbox environment when you sign up to Rebilly. For more information on payment gateway settings, see Set up a payment gateway.
- Log in or sign up to Rebilly.
- In the left navigation bar, press Settings.
- In the Configuration section, press Gateway accounts.
- In the ID column, press TestProcessor.
- In the right of the page, press Edit gateway account.
- Scroll down to the Ready to payout instruction section, and turn on the Activate this gateway for payouts toggle.
- Select one of the following options:
- Covered payout: Process payouts on this gateway only if it previously processed a payment for the same, or a greater, amount.
- Approved payments: Process payouts of any amount on this gateway if the customer has a previously approved transaction, in the same currency, on this gateway.
- All payments: Process payouts of any amount on this gateway.
- Scroll to the bottom of the page and press Save gateway account.
To learn how to configure which payout methods are displayed to customers, see Configure payout methods displayed to customers.
Learn how to get your website ID, organization ID, and API keys in your Rebilly sandbox account.
When you first log in to Rebilly, you create an organization as part of the setup process. A default website is created when a new organization is created. For more information, see Organizations and websites.
Obtain your organization ID and website ID
- Log in or sign up to Rebilly.
- In the left navigation bar, press Settings.
- In the Management section, press My organization & websites.
- In the Organization details section, note the ID value.
- In the Website section, note the ID value.
Obtain your publishable API key
- Log in or sign up to Rebilly.
- In the left navigation bar, press Automations.
- In the Development section, press API keys.
If you do not have any publishable API keys, see Create an API key. - Select a publishable key and copy the Key value.
Obtain your secret API key
A secret key is displayed in full only once, after you create it. If you stored a secret key when you created it, use that key. Otherwise, create a new secret key:
- Log in or sign up to Rebilly.
- In the left navigation bar, press Automations.
- In the Development section, press API keys.
- Press Create API key and create a secret key.
For more information, see Create an API key. - Press Copy, store the key in a secure place, and press Done.
If your website uses a Content Security Policy (CSP), complete this section before you embed payment forms. This is not required for hosted payment forms.
Embedded forms load content in iframes from two Rebilly domains:
framepay.rebilly.comserves the payment card fields. If this domain is not in theframe-srcdirective, the card number, expiration date, and CVV fields do not render.www.secure-payments.appserves 3D Secure authentication and other approval flows during payment confirmation. If this domain is not in theframe-srcdirective, a blank modal is displayed after a customer enters payment details and presses confirm.
To update your CSP:
- Add
https://*.rebilly.comandhttps://*.secure-payments.appto theframe-srcdirective. - Optionally, if your CSP restricts external scripts or API calls: Add
https://*.rebilly.comto thescript-srcandconnect-srcdirectives. - Deploy or publish the updated CSP before you test payments.
This section describes how to add data to your sandbox environment using the Rebilly API.
This API interaction creates a product in your Rebilly sandbox account. For more information, see Create a product.
To create a product you must have your Rebilly website ID, organization ID, and secret API key. For more information, see Obtain IDs and API keys.
How to use the interactive example
- Enter your organization ID:
- Locate and press
server /, then in the Server variables section, press . - In the Value field, enter your organization ID and press Save.
- Locate and press
- Enter your secret API key:
- Press Security.
- In the API key field, enter your secret Rebilly sandbox API key.
For more information, see Obtain IDs and API keys.
- Optionally, to change the product details, press Body.
- Press Send.
The id value from this response is used in Create a pricing plan.
This API interaction creates a pricing plan for a product in your Rebilly sandbox account. For more information, see Create a plan.
To create a pricing plan, you must have a product ID. For more information, see Create a product.
How to use the interactive example
- Enter your organization ID:
- Locate and press
server /, then in the Server variables section, press . - In the Value field, enter your organization ID and press Save.
- Locate and press
- Enter your secret API key:
- Press Security.
- In the API key field, enter your secret Rebilly sandbox API key.
For more information, see Obtain IDs and API keys.
- Enter the product ID from the Create a product response.
- Press Body.
- In the
productIdfield, enter theidvalue from the Create a product response. - Optionally, change the plan details.
- Press Send.
This API interaction creates a customer in your Rebilly sandbox account and also prevents duplicate customers. If the customer already has an identifier within your system, that customer is updated. If the customer does not have an identifier, a new customer is created.
For detailed information about this API operation, see Upsert a customer.
How to use the interactive example
- Enter your organization ID:
- Locate and press
server /, then in the Server variables section, press . - In the Value field, enter your organization ID and press Save.
- Locate and press
- Enter your secret API key:
- Press Security.
- In the API key field, enter your secret Rebilly sandbox API key.
For more information, see Obtain IDs and API keys.
- Enter a customer ID:
- Press Path.
- In the input field, enter a customer ID. Example:
cus_01HDP7FFX2PGDVH1995EA4QY95.
- Enter your website ID:
- Press Body.
- In the
websiteIdfield, enter your website ID. - Optionally, change the customer details.
- Press Send.
Take note of theidvalue from this response. This value is used as thecustomerIdlater in this tutorial.
This API interaction creates an order in your Rebilly sandbox account. A recurring order in the sandbox environment is canceled 90 days after it is created, unless the order is retained. For more information, see Retain a recurring order in the sandbox using the API.
To create an order, you must have a customer ID and a plan ID. For more information, see Create a customer and Create a pricing plan.
How to use the interactive example
- Enter your organization ID:
- Locate and press
server /, then in the Server variables section, press . - In the Value field, enter your organization ID and press Save.
- Locate and press
- Enter your secret API key:
- Press Security.
- In the API key field, enter your secret Rebilly sandbox API key.
For more information, see Obtain IDs and API keys.
- Enter the customer ID, plan ID, and website ID:
- Press Headers, then in the
Organization-Idfield, enter your organization ID. - Press Body.
- In the
customerIdfield, enter theidvalue from the create a customer response. - In
items.plan.id, enter theidvalue from the create a pricing plan response. - In the
websiteIdfield, enter your website ID.
- Press Headers, then in the
- Press Send.