Skip to main content

pay.payment_connector_url

The payment_connector_url is a required URL that processes payment requests during the payment flow. It receives payment details once all required information has been gathered from the user, and it processes the final payment transaction, returning the results in the response.

NameTypeDescription
payment_connector_urlstringThe URL to which payment requests are sent after all required payment details have been provided.

Payment connector URL request

SignalWire sends a POST request to the URL specified in the payment_connector_url parameter. The connector URL receives these details once all required payment information has been collected from the user.

NameTypeDescription
transaction_idstringThe unique identifier for the transaction.
methodstringThe payment method.
cardnumberstringThe card number.
cvvstringThe CVV.
postal_codestringThe postal code.
descriptionstringThe description.
chargeAmountstringThe charge amount.
token_typestringThe token type.
expiry_monthstringThe expiry month.
expiry_yearstringThe expiry year.
currency_codestringThe currency code.

Request format

The request body is a JSON object containing the payment details.

Request Body Example
{
"transaction_id": "8c9d14d5-52ae-4e2e-b880-a14e6e1cda7d",
"method": "credit-card",
"cardnumber": "************1234",
"cvv": "***",
"postal_code": "123456",
"description": "Payment description",
"chargeAmount": "10.55",
"token_type": "reusable",
"expiry_month": "12",
"expiry_year": "99",
"currency_code": "usd"
}

Response format

Your payment connector endpoint should respond with specific formats for both successful and failed transactions. The response format varies depending on whether you are processing a charge transaction or generating a token.

Successful response

For a successful charge transaction, return a 200 HTTP status code with a JSON response containing:

FieldTypeDescription
charge_idstringA unique identifier for the successful transaction.
error_codenullMust be null for successful transactions.
error_messagenullMust be null for successful transactions.
{
"charge_id": "ch_123456789",
"error_code": null,
"error_message": null
}

Error response

note

The error response will trigger the corresponding payment-failed prompt in your SWML application.

For failed charge transactions, return a non-200 HTTP status code with a JSON response containing:

{
"charge_id": null,
"error_code": "insufficient_funds",
"error_message": "Card has insufficient funds"
}
FieldTypeDescription
charge_idnullMust be null for failed transactions.
error_codestringAn error code identifying the type of failure.
error_messagestringA human-readable description of the error.