# `Twilio.Api.V2010.Call.PaymentService`
[🔗](https://github.com/jeffhuen/twilio_elixir/blob/main/lib/twilio/api/v2010/call/payment_service.ex#L2)

Twilio enabled secure payments solution for accepting credit and ACH payments over the phone.

Operations: `create`, `update`

# `create`

```elixir
@spec create(Twilio.Client.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Api.V2010.Call.Payment.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

create an instance of payments. This will start a new payments session

Operation: `CreatePayments` | Tags: Api20100401Payment

## Required Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `IdempotencyKey` | string | 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. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `StatusCallback` | string (uri) | Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [expected StatusCallback values](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback) |
## Optional Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `BankAccountType` | string |  Values: `consumer-checking`, `consumer-savings`, `commercial-checking` |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `ChargeAmount` | number | A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Currency` | string | The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Description` | string | 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. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Input` | string | A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `MinPostalCodeLength` | integer | A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Parameter` | string | 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](https://www.twilio.com/console/voice/pay-connectors). |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `PaymentConnector` | string | This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [<Pay> Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. |
| `PaymentMethod` | string |  Values: `credit-card`, `ach-debit` |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `PostalCode` | boolean | 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 is `true`. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `SecurityCode` | boolean | Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Timeout` | integer | 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 is `5`, maximum is `600`. |
| `TokenType` | string |  Values: `one-time`, `reusable`, `payment-method` |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `ValidCardTypes` | string | Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` |

# `update`

```elixir
@spec update(Twilio.Client.t(), String.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Api.V2010.Call.Payment.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

update an instance of payments with different phases of payment flows.

Operation: `UpdatePayments` | Tags: Api20100401Payment

## Required Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `IdempotencyKey` | string | 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. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `StatusCallback` | string (uri) | Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [Update](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-update) and [Complete/Cancel](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-cancelcomplete) POST requests. |
## Optional Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Capture` | string |  Values: `payment-card-number`, `expiration-date`, `security-code`, `postal-code`, `bank-routing-number`, `bank-account-number` |
| `Status` | string |  Values: `complete`, `cancel` |

---

*Consult [api-reference.md](api-reference.md) for complete listing*
