- Receipt ID.
- Mastercard customer ID.
- Mastercard account ID.
Need a Mastercard token? See Create a Mastercard token for Straddle.
Before you begin
Confirm the following:- Create a customer in Straddle. The customer cannot be
inactiveorrejected. - Use a Mastercard consent receipt that includes
moneyTransferDetails,accountOwner, andavailableBalanceLivefor the same account.
Create the paykey
Send the following IDs toPOST /v1/bridge/mastercard.
The Mastercard values must come from the same consent receipt.
Create a paykey from a Mastercard token
inline processing is the default. If Straddle returns a pending paykey, processing continues asynchronously and Straddle sends status changes through paykey webhook events.
Read the response
An inline request that creates anactive paykey returns 201 Created.
Example active response
Example active response
data.paykey for charges and payouts. Straddle uses the available balance returned by Mastercard and falls back to the cleared balance when Mastercard does not return an available balance.
Store the Mastercard token with the account connection. You’ll need the consent receipt ID to revoke Mastercard access.
Act on the paykey status
Usedata.status to decide the next action.
For a
review result, follow the manual review process. See Paykey status details for the full lifecycle.
Recover from errors
For aninline request, use the HTTP status code to decide how to handle the error. For asynchronous processing, use the paykey status from paykey webhook events.
Recognized Mastercard token failures return 422 Unprocessable Entity during inline processing. Straddle maps them to these diagnostic messages:
During asynchronous processing, a failure listed in the table changes the paykey to
rejected and sends a paykey webhook event. Other failures leave the paykey in pending while Straddle retries.
During inline processing, a Mastercard failure that is not listed in the table returns 500 Internal Server Error. Contact Straddle before retrying and include meta.api_request_id.
Keep the Mastercard token available
When you create the Mastercard token, setmaxCalls and accessPeriod for each product. Mastercard’s Generate Third Party Access Key example uses maxCalls: 200. See Set the token scope.
Unless your use case has a set expiration date, set
accessPeriod.endTime as far into the future as your Mastercard configuration allows. Contact Mastercard for more information about access periods and call limits.active and keeps its last bank data and balance.
If Straddle cannot refresh the balance for a charge:
disabled: Straddle does not request a balance.enabled: The charge can continue without a completed balance check.required: The charge fails because Straddle cannot verify the balance.
Test in sandbox
Create the Mastercard token in Mastercard’s sandbox, then send the Bridge request tohttps://sandbox.straddle.com.
Name matching runs when config.sandbox_outcome is standard. Set config.sandbox_outcome to active, rejected, or review to force that paykey status. Use expired, revoked, under-scoped, and exhausted Mastercard tokens to test the recovery paths.
See Sandbox testing for Pay by Bank for more scenarios.
Disconnect the account
Complete both actions when the customer disconnects the account:- Call Mastercard’s Revoke Third Party Access operation with the consent receipt ID.
- Cancel the Straddle paykey.