Skip to main content

Documentation

Recurring Digital Wallet Payments

To enable recurring digital wallet payments for subsequent Create Payment and hosted checkout page payments, you must run an initial Create Payment request.

How

Note

These settings are relevant to both Apple Pay and Google Pay digital wallets.

Create a payment as described in Create Payment, with the following settings:

  • Set Save_payment_method field to true.

  • Set payment_method.fields.recurrence_type to recurring.

Create Payment request

Note

The following is an example of an initial recurring payment with Google Pay. Same settings apply for Apple Pay.

curl -X post
https: //sandboxapi.rapyd.net/v1/payments/
-H 'access_key: your-access-key-here'
-H 'Content-Type: application/json'
-H 'idempotency: your-idempotency-parameter-here'
-H 'salt: your-random-string-here'
-H 'signature: your-calculated-signature-here'
-H 'timestamp: your-unix-timestamp-here'
-d '{
    "amount": 10,
    "currency": "EUR",
    "merchant_reference_id": "first",
    "save_payment_method": true,
    "payment_method": {
        "fields": {
            "recurrence_type": "recurring"
        },
        "type": "gb_visa_card",
        "digital_wallet": {
            "type": "google_pay",
            "details": {
                "token": {
                    "apiVersion": 2,
                    "apiVersionMinor": 0,
                    "paymentMethodData": {
                        "description": "Test Card: Visa •••• 1111",
                        "info": {
                            "assuranceDetails": {
                                "accountVerified": true,
                                "cardHolderAuthenticated": false
                            },
                            "cardDetails": "1111",
                            "cardNetwork": "VISA"
                        },
                        "tokenizationData": {
                            "token"AIe4rFbc1cjySiBhWb4QUyblKVrRIyRiQQpxR4VBGBiA\\u003d\\u003d\",\"intermediateSigningKey\":{\"signedKey\":\"{\\\"keyValue\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7sFAN8hadmcbPjxA5/Lbrj8PaeCpkH0ynQyvJJ/NSHgUaIodofNEwLytEaRIJnMKqh0l4q62cm6ehbfQckjKDQ\\\\u003d\\\\u003d\\\",\\\"keyExpiration\\\":\\\"1727835726739\\\"}\",\"signatures\":[\"MEYCIQDIPQWWKdeG641fLkXHdQUVGk+54Ry6YKSM2gfmjh/CwgIhAMeOzGaVviVu69vxWJ+rOQ6FagO3rbH5G1RbrbZ0pElr\"]},\"protocolVersion\":\"ECv2\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"+L5o5STlDwoQ+6r7FSV3UFoPRfGDND91xDKUVgiq+QtSPA3vQajUchuJy/oQiwag2U1dwdioPjIvU6S2ctRFCw1xh/24pv0hftWZ//xnEK0g8XZA+8QLQTH47NITMh22wWBgiLVTSQGIQZ1QS9oKKOPQTBeUBYWW0cLQ7NUqvlMnJyF9uS4mnzAduXPtWNdF3QtoupjojPsQS7WoPoCSajloki9wpMnzlrumI0b+TiP311r3NNaN1D5p/5LJ8DHtDeZgqyUd/wFgmz1lRn5Zf70cHbMRbRW71NDWg5qJT1bRrGwRpaSQpyJZJ+JgRr4HCf7P04go9T6ZKLVSJvCxWu7zs3uixZy2XxwadN4/0qaOnbfxkUYyA/jVPUp3kRpdLFMbwuysVmXe9NscMS9K9dQxsEYFyFgkC8+ZpHb+8xdpHIIj7D/nYzSIOOasbQTYzax+iaApZFzJFNEYSo+XFTLxAYBoA4SiM2nS6L1c\\\",\\\"ephemeralPublicKey\\\":\\\"BCmuGLHSNCxJkRkpwwLYy7rqj9gSZfMR+8W3i86yiC7vKLxcHrpeoO7DE\\\\u003d\\\",\\\"tag\\\":\\\"DhtBmQJn39tx96UK7FSuT/C29afIXSLcf0\\\\u003d\\\"}\"}",
                            "type": "PAYMENT_GATEWAY"
                        },
                        "type": "CARD"
                    }
                }
            }
        }
    },
    "payment_method_options": {
        "3d_required": true
    }
}

Create Payment response

{
    "status": {
        "error_code": "",
        "status": "SUCCESS",
        "message": "",
        "response_code": "",
        "operation_id": "6e271926-fa23-4626-ae75-615de5e2c4ab"
    },
    "data": {
        "id": "payment_103215dc36ec28a790d27dd37c4b1bc8",
        "amount": 0,
        "original_amount": 10,
        "is_partial": false,
        "currency_code": "EUR",
        "country_code": "GB",
        "status": "ACT",
        "description": "",
        "merchant_reference_id": "first",
        "customer_token": "cus_5b1690b05983433797a991bdf02522ca",
        "payment_method": "card_3e792d4013201498284edf310c5c1dc8",
        "payment_method_data": {
            "id": "card_3e792d4013201498284edf310c5c1dc8",
            "type": "gb_visa_card",
            "category": "card",
            "metadata": null,
            "image": "",
            "webhook_url": "",
            "supporting_documentation": "",
            "next_action": "3d_verification",
            "digital_wallet": {
                "type": "google_pay",
                "pan_type": "PAN_ONLY"
            }
        },
        "auth_code": null,
        "expiration": 1728387331,
        "captured": true,
        "refunded": false,
        "refunded_amount": 0,
        "receipt_email": "",
        "redirect_url": "https://sandboxcheckout.rapyd.net/3ds-payment?token=payment_103215dc36ec28a790d27dd37c4b1bc8",
        "complete_payment_url": "",
        "error_payment_url": "",
        "receipt_number": "",
        "flow_type": "",
        "address": null,
        "statement_descriptor": "Doc Team",
        "transaction_id": "",
        "created_at": 1727782531,
        "metadata": {},
        "failure_code": "",
        "failure_message": "",
        "paid": false,
        "paid_at": 0,
        "dispute": null,
        "refunds": null,
        "order": null,
        "outcome": null,
        "visual_codes": {},
        "textual_codes": {},
        "instructions": [],
        "ewallet_id": "ewallet_c1943cfeda5f98247ab117e5d2648861",
        "ewallets": [
            {
                "ewallet_id": "ewallet_c1943cfeda5f98247ab117e5d2648861",
                "amount": 10,
                "percent": 100,
                "refunded_amount": 0
            }
        ],
        "payment_method_options": {
            "3d_required": true
        },
        "payment_method_type": "gb_visa_card",
        "payment_method_type_category": "card",
        "fx_rate": 1,
        "merchant_requested_currency": null,
        "merchant_requested_amount": null,
        "fixed_side": "",
        "payment_fees": null,
        "invoice": "",
        "escrow": null,
        "group_payment": "",
        "cancel_reason": null,
        "initiation_type": "customer_present",
        "mid": "",
        "next_action": "3d_verification",
        "error_code": "",
        "remitter_information": {},
        "save_payment_method": true
    }
}

The response shows:

  • A payment via a card in Google Pay ran successfully.

  • The payment method has been saved for subsequent payments.

Related Information