Welcome to our new developer portal! Use the "Ask" button to chat with our AI Agent.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Implementar pago remoto DSRP

Resumen

Use Mastercard DSRP remote payment to generate payment data for remote acceptance (for example, e-commerce).

In this flow, your digital wallet application generates payment data. You then pass that data to your merchant system or payment gateway for authorization.

Before you implement DSRP remote payments, complete Tokenización. Ver Tokenizar una tarjeta.

Integración del SDK

Comprobar los requisitos previos

Confirm the digital card supports DSRP remote payment using DigitalCard.Details.isPaymentTypeSupported() con PaymentType.dsrp.

func checkCardSupportForDSRP(card: DigitalCard) async throws -> Bool {
    return try await card.details.isPaymentTypeSupported(.dsrp)
}

Create the DSRP payment input data

Before generating DSRP payment data, you must provide the input data in RemotePaymentInputData.

RemotePaymentSession.RemotePaymentInputData has the following fields:

Input data
Type
Formato
Descripción

amount

Cadena

Numeric, minor units

Required Transaction amount in minor units (no decimal separator). For example, 119.00 USD is 11900 (then left-pad if your integration requires fixed length).

currencyCode

Cadena

3-digit ISO 4217 numeric

Required Transaction currency code. For example, USD is 840.

countryCode

Cadena

3-digit ISO 3166-1 numeric

Required Merchant country code. For example, United States is 840.

transactionType

Enum

.purchase

Required Financial transaction type. For DSRP payments, use .purchase.

cryptogramType

Enum

.ucaf o .de55

Required Cryptogram data format returned by the SDK.

unpredictableNumber

Cadena

Numeric

Required Random number generated by the merchant or payment gateway.

Generate DSRP payment data

In your digital wallet application, call RemotePaymentSession.generateRemotePayment().

This API can throw an error. See Manejar errores.

On success, the API returns RemotePaymentOutputData with the following fields:

Parámetro
Descripción

cryptogramData

Byte array containing the formatted response. This is either UCAF or TLV data for the merchant to populate DE-55.

pan

PAN with any F padding removed (if present).

panSequenceNumber

PAN sequence number (PSN) of the card used.

track2EquivalentData

Track 2 data elements per ISO/IEC 7813 (excluding start sentinel, end sentinel, and LRC): PAN, field separator (D), expiration date (YYMM), service code, discretionary data, and optional F padding.

par

Payment account reference (PAR), if provided by the payment network.

expirationDate

Card expiration date.

cryptogramDataType

Cryptogram format returned (UCAF or DE55).

Manejar errores

If generateRemotePayment() throws an error, treat the payment as failed. Reset your UI state. Guide the end user to the next best action.

Error
Descripción

deviceEnvironmentUnsafe

The device does not meet the security requirements.

sessionInProgress

Another payment session is still running.

invalidInputData

One or more fields in RemotePaymentInputData are missing or malformed.

noPaymentKeys

No payment keys are available for the transaction.

cardNotSupported

The digital card does not support DSRP remote payment.

cardNotActive

The digital card is not active.

noDefaultCard

No default card is set.

clientError

The remote payment flow failed due to a client-side error (for example, a network issue).

authenticationKeyInvalidated

The device passcode was disabled and secure storage was wiped.

biometricNotEnrolled

Biometrics are unavailable or not enrolled.

Each error can include a message that explains the failure. Use it for troubleshooting and support diagnostics.

Full implementation example

Use este ejemplo de código para entender cómo encajan los pasos anteriores.

Última actualización

¿Te fue útil?