Repository navigation
Pay fixes (SWML + cXML) - #833
Conversation
Manny-r31
left a comment
There was a problem hiding this comment.
Thanks for this, it clears up a lot on both pages. Two things have changed on the platform since this was written:
-
Payment connector requests are now signed. SignalWire signs the request to the payment connector the same way it signs JSON webhooks:
X-SignalWire-Signatureis the lowercase hex HMAC-SHA1 of the connector URL (with anyuser:pass@removed) followed by the raw request body, keyed with the project's Signing Key.X-SignalWire-SHA256-Signaturecarries the HMAC-SHA256.
This applies to
<Pay>too, and it is not the form-parameter scheme the other cXML webhooks use, so a cXML user's usual validator won't match. Credentials in the URL still arrive as Basic auth, so they become an optional second layer. I left inline suggestions on the three places that say the request isn't signed. -
The
token_idfix has landed. The connector'stoken_idnow comes back asPaymentToken/pay_payment_results.payment_token. The page text already states this as current behavior, so it only needs the "approved but not yet deployed" note dropped from the PR description.
Both platform changes need changelog entries dated to when they reached customers. I'm confirming the deploy dates and will add them separately, so this PR doesn't need to.
#867 (the new Take payments on a call guide) adds one-sentence backlinks to both of these pages. It should merge after this one, and I'll rebase it.
Co-authored-by: Manny <mannyr31@yahoo.com>
Co-authored-by: Manny <mannyr31@yahoo.com>
Co-authored-by: Manny <mannyr31@yahoo.com>
Co-authored-by: Manny <mannyr31@yahoo.com>
Description
Brings the cXML
<Pay>and SWMLpayreference pages in line with the platform, verified against the platform and the API spec. Tokenization is the main fix: the pages now say plainly that the connector'stoken_idcomes back asPaymentToken/pay_payment_results.payment_token.cXML
<Pay>ProfileId(never sent), describedPaymentTokenandPaymentConfirmationCodeprecisely, rewrote the broken<Note>, and added a "Tokenize a card end to end" example.actionparameters: renamed to what's sent (PayResult,PaymentCardExpirationDate,PaymentCardSecurityCode,PaymentErrorCode,PaymentConnectorError), and addedPaymentConnectorErrorCodeandBankAccountType.chargeAmount(string, notamount) andparameters(an array of single-key objects), and used an unmasked test card in the example.statusCallback: completed theForvalues, merged the duplicate events table into them, and noted thatpayment-completedis also sent for declines.minPostalCodeLengthandsecurityCodeare optional (defaults0/true), andpaymentConnectorUrlmust be HTTPS.</Pay>,<Prompt name=→for=, and garbled characters.SWML
payparameterswas missing from the request body.params.fornow lists its values, with the samepayment-completedcaveat.Spec
pay/main.tsp: the doc links now point to/docs/swml/reference/calling/pay. The regenerated output changes only those two links.Notes for reviewers
PaymentToken/payment_tokendescriptions describe intended behavior. A platform fix that returnstoken_idthere is approved but not yet deployed.paymentConnectorUrl, the undocumentedbankAccountType/voiceattributes and ACH connector fields, and legacy heading styles.Preview:
/docs/compatibility-api/cxml/reference/voice/pay/docs/swml/reference/calling/payType of Change
Related Issues
Closes #832
See also: signalwire/cloud-product#21804
Testing
Checklist