Save Card Details With Rapyd Checkout
The Rapyd Checkout page allows you to save a customer’s card details when they make a payment. You can use the saved payment information for future payments.
The saved card information is tokenized, which follows PCI-DSS standards. This allows sensitive information to be stored safely. Saving card details using the Rapyd Checkout Page enables you to link the card details to the customer.
Enter your card information.
(Optional): Click the Save card for future payments checkbox.
Click Place Your Order to complete the payment.
Redirect to the payment success page.
Click Finish.
You request Rapyd to generate a Hosted Checkout Page.
Rapyd processes your request and sends the response with the redirect URL.
You display the redirect URL to the customer.
The customer completes the payment on the hosted page.
The message sequence diagrams below describe how information is exchanged between Rapyd, the merchant, the merchant's customers, and the card network.
Card Payment Rapyd Checkout - Success
Card Payment Rapyd Checkout - Failure
You need to complete the following steps in order to generate a Hosted Checkout Page:
Create a Customer (API Integration or via the Client Portal)
Generate a Hosted Checkout Page (API Integration or via the Client Portal)
You must pass the customer ID (a string starting with cus_) in the request when generating the Hosted Checkout Page. This enables the card details to be saved for future payments.
Description of Body Parameters
See Create Checkout Page for additional details about the parameters.
Body Parameter | Required | Description |
---|---|---|
amount | yes | The amount of the payment, in units of currency defined in currency. |
country | yes | The two-letter ISO 3166-1 ALPHA-2 code for the country. |
currency | yes | Three-letter ISO 4217 code for the currency. |
customer | no | ID of the customer, a string starting with cus_. Note: Must be included to enable the card details to be saved. |
Create Checkout Page Request
Request
// Request URL: POST https://sandboxapi.rapyd.net/v1/checkout // Message body: { "amount": 123.45, "complete_payment_url": "http://example.com/complete", "country": "GB", "currency": "GBP", "customer": "cus_ecfab8b87e2fa11d66b95cc1f2c94037", "error_payment_url": "http://example.com/error", "merchant_reference_id": "950ae8c6-78", "cardholder_preferred_currency": true, "language": "en", "metadata": { "merchant_defined": true }, "expiration": 1708498532, "payment_method_types_exclude": [] }
Create Checkout Page Response
Create Checkout Page describes the fields in the response.
Response
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "47d0211e-9da3-4846-ae28-f7fc1d2438da" }, "data": { "id": "checkout_0d7e080a7162c785ebcb8b416b1c0860", "status": "NEW", "language": "en", "merchant_color": null, "merchant_logo": null, "merchant_website": "https://www.rapyd.net", "merchant_customer_support": {}, "merchant_alias": "N/A", "merchant_terms": null, "merchant_privacy_policy": null, "page_expiration": 1708565261, "redirect_url": "https://sandboxcheckout.rapyd.net/?token=checkout_0d7e080a7162c785ebcb8b416b1c0860", "merchant_main_button": "place_your_order", "cancel_checkout_url": "https://www.rapyd.net", "complete_checkout_url": "https://www.rapyd.net", "country": "GB", "currency": "GBP", "amount": 123.45, "payment": { "id": null, "amount": 123.45, "original_amount": 0, "is_partial": false, "currency_code": "GBP", "country_code": "GB", "status": null, "description": "Payment via Checkout", "merchant_reference_id": "950ae8c6-78", "customer_token": "cus_ecfab8b87e2fa11d66b95cc1f2c94037", "payment_method": null, "payment_method_data": {}, "expiration": 1708498532, "captured": false, "refunded": false, "refunded_amount": 0, "receipt_email": null, "redirect_url": null, "complete_payment_url": "http://example.com/complete", "error_payment_url": "http://example.com/error", "receipt_number": null, "flow_type": null, "address": null, "statement_descriptor": null, "transaction_id": null, "created_at": 0, "updated_at": 0, "metadata": { "merchant_defined": true }, "failure_code": null, "failure_message": null, "paid": false, "paid_at": 0, "dispute": null, "refunds": null, "order": null, "outcome": null, "visual_codes": {}, "textual_codes": {}, "instructions": {}, "ewallet_id": null, "ewallets": [], "payment_method_options": {}, "payment_method_type": null, "payment_method_type_category": null, "fx_rate": null, "merchant_requested_currency": null, "merchant_requested_amount": null, "fixed_side": null, "payment_fees": null, "invoice": null, "escrow": null, "group_payment": null, "cancel_reason": null, "initiation_type": null, "mid": null, "next_action": "not_applicable" }, "payment_method_type": null, "payment_method_type_categories": null, "payment_method_types_include": null, "payment_method_types_exclude": [], "account_funding_transaction": null, "customer": "cus_ecfab8b87e2fa11d66b95cc1f2c94037", "custom_elements": { "save_card_default": false, "display_description": false, "payment_fees_display": true, "merchant_currency_only": false, "billing_address_collect": false, "dynamic_currency_conversion": false }, "timestamp": 1707355661, "payment_expiration": null, "cart_items": [], "escrow": null, "escrow_release_days": null } }