Twilio. Calls. Payments
(twilio v0.2.0)
Copy Markdown
API calls: create, update.
Summary
Functions
create an instance of payments. This will start a new payments session
Like create/3, but returns the result or raises Infusion.Runtime.Error.
update an instance of payments with different phases of payment flows.
Like update/4, but returns the result or raises Infusion.Runtime.Error.
Functions
@spec create(String.t(), map() | keyword(), keyword()) :: {:ok, Twilio.Schemas.Payments.t()} | {:error, Infusion.Runtime.Error.t()}
create an instance of payments. This will start a new payments session
POST /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Payments.json
Path parameters
call_sid(required) - The SID of the call that will create the resource. Call leg associated with this sid is expected to provide payment information thru DTMF.
{AccountSid} in the path is the :account_sid setting; pass account_sid: "..." as an option to use another.
Parameters
bank_account_typecharge_amount- A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten withcurrencyfield. Leave blank or set to 0 to tokenize.confirmation- Whether to prompt the caller to confirm their payment information before submitting to the payment gateway. Iftrue, the caller will hear the last 4 digits of their card or account number and must press 1 to confirm or 2 to cancel. Default isfalse.currency- The currency of thecharge_amount, formatted as ISO 4127 format. The default value isUSDand all values allowed from the Pay Connector are accepted.description- The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions.idempotency_key(required) - A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated.input- A list of inputs that should be accepted. Currently onlydtmfis supported. All digits captured during a pay session are redacted from the logs.min_postal_code_length- A positive integer that is used to validate the length of thePostalCodeinputted by the user. User must enter this many digits.parameter- A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the <Pay> Connector. Read more.payment_connector- This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about <Pay> Connectors. The default value isDefault.payment_methodpostal_code- Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default istrue.require_matching_inputs- A comma-separated list of payment information fields that require the caller to enter the same value twice for confirmation. Supported values arepayment-card-number,expiration-date,security-code, andpostal-code.security_code- Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default istrue.status_callback(required) - Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the expected StatusCallback valuestimeout- The number of seconds that <Pay> should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is5, maximum is600.token_typevalid_card_types- Credit card types separated by space that Pay should accept. The default value isvisa mastercard amex
@spec create!(String.t(), map() | keyword(), keyword()) :: Twilio.Schemas.Payments.t()
Like create/3, but returns the result or raises Infusion.Runtime.Error.
@spec update(String.t(), String.t(), map() | keyword(), keyword()) :: {:ok, Twilio.Schemas.Payments.t()} | {:error, Infusion.Runtime.Error.t()}
update an instance of payments with different phases of payment flows.
POST /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Payments/{Sid}.json
Path parameters
call_sid(required) - The SID of the call that will update the resource. This should be the same call sid that was used to create payments resource.sid(required) - The SID of Payments session that needs to be updated.
{AccountSid} in the path is the :account_sid setting; pass account_sid: "..." as an option to use another.
Parameters
captureidempotency_key(required) - A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated.statusstatus_callback(required) - Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the Update and Complete/Cancel POST requests.
Like update/4, but returns the result or raises Infusion.Runtime.Error.