Skip to contentSkip to navigationSkip to topbar
Rate this Page:

Pay Connectors


Pay Connectors are integrations with payment processors/gateways that allow you to tokenize payment details and create charges on credit and debit cards. In a matter of minutes, a merchant or ISV (independent software vendor) can start accepting payments over a phone call without having to become PCI Compliant(link takes you to an external page).

pay-diagram-1-final.

A tokenized payment is a payment that doesn't have any charge associated to it. A tokenized payment returns a token which represents a payment method information in the payment provider system (e.g. customer ID). In order to tokenize a payment using <Pay>, the chargeAmount should be 0 or not present.

A charge transaction means you want to immediately capture funds from the customer's supplied payment method (i.e. credit card) in return for the goods or services you offer. In order to create a charge transaction with <Pay>, the chargeAmount should be greater than 0.

Pay Connectors are available as a part of Twilio Programmable Voice. You can choose your preferred payment processor/gateway and instantly install it for free. Once installed, you must authorize Twilio to initiate transactions on your behalf.

Pay Connectors Console page listing available Pay Connectors.

Supported products

supported-products page anchor

Twilio Pay Connectors are currently supported only by Programmable Voice. Navigate to Pay Connectors(link takes you to an external page) in Twilio console to see list of available connectors.

If you don't see your preferred payment processor/gateway in the list of branded connectors, you can use a Generic Pay Connector. Note: The payment processor/gateway will need to write custom, PCI-compliant code to work with Twilio's Generic Pay Connector.


Install and configure a Pay Connector

install-and-configure-a-pay-connector page anchor

Install Pay Connectors

install-pay-connectors page anchor

Twilio's available Pay Connectors can be found here in the Console(link takes you to an external page). To get started, click on your preferred Pay Connector and install it. This creates an instance of the Pay Connector that you can configure with a Unique Name (Not treated as PII by Twilio).

Use 'Default' as Unique Name for Pay Connector. Stripe Connector Page pointing to Unique Name of 'Default'.

Configuration and authorization

configuration-and-authorization page anchor

Each Pay Connector instance must be given a unique name as highlighted in the above diagram. The Unique Name must be unique to this Twilio account. If you enter Default, then when you invoke <Pay> you don't have to specify a paymentConnector attribute.

If you have multiple Pay Connector instances, you should use the paymentConnector attribute in your <Pay> verb to indicate which Pay Connector you want to use. See here to learn how to use <Pay>.

For example, to use a Pay Connector instance with a unique name of Stripe_Connector_1, use the following:

Use a named Pay Connector

use-a-named-pay-connector page anchor

Capture payment using a named connector instead of the default.

Node.js
Python
C#
Java
PHP
Ruby

_10
const VoiceResponse = require('twilio').twiml.VoiceResponse;
_10
_10
_10
const response = new VoiceResponse();
_10
response.pay({
_10
paymentConnector: 'Stripe_Connector_1'
_10
});
_10
_10
console.log(response.toString());

Output

_10
<?xml version="1.0" encoding="UTF-8"?>
_10
<Response>
_10
<Pay paymentConnector="Stripe_Connector_1" />
_10
</Response>

To initiate transactions from Twilio to the payment processor/gateway, you must first have an account set up with the payment processor/gateway. Make sure to authorize Twilio to initiate transactions on your behalf.

When you configure the Pay Connector instance you will do one of the following:

  1. Provide your credentials/secret keys for the payment processor/gateway.
  2. Authorize Twilio using a revocable access token.
(information)

Info

When possible, please provide authorization that is scoped to only tokenization or charges. Not all payment processors/gateways make this possible.


Create multiple instances of a Pay Connector

create-multiple-instances-of-a-pay-connector page anchor

Twilio supports creating multiple instances of a Pay Connector. This means that you can create one instance of a Pay Connector for your production environment, another for your staging environment, and the third instance for your development environment.
If using Stripe(link takes you to an external page), you might create the following three instances:

#EnvironmentPay Connector Instance Unique NameStripe Mode
1ProductionStripe_ProdLive
2StagingStripe_StageTest
3DevelopmentStripe_DevTest

Pay Connectors are provided and supported by Twilio. As a part of the Pay Connector installation process, you are required to accept Twilio's Terms of Service.

The Pay Connector is provided under https://www.twilio.com/en-us/pci-compliance(link takes you to an external page). Documentation specific to each payment gateway can be found on the Console under the documentation tab of the corresponding Pay Connector.


Don't see the payment processor/gateway you're looking for?

dont-see-the-payment-processorgateway-youre-looking-for page anchor

Help us prioritize our next Pay Connector to your preferred payment processor/gateway by requesting here(link takes you to an external page).


Learn how to capture your first payment using <Pay> with this Pay Connector tutorial.


Rate this Page: