Multiple Payment Method on Toolkit

Hello all,
here I am again.

I’ve successfully integrated the checkout with the toolkit, handle cards and banks payment.
Now I’m just trying to have both together but it doesn’t want to work.

I’ve tried to:

  • specified the paramenter: payment_method_type_categories with bank_redirect and card. The system seems to accept only the first parameter. It doesn’t return any error, it just shows only the first paramenter whatever is it;
  • making a GET request to retrieve the list of available payment methods based on country code and then setting payment_method_types_include with the result. Again no errors, though only the first kind of payment method that come from the GET request are shown.

Is there anything that I am missing?

1 Like

Thanks @salvosav,

Great question. Have you checked out Configuring List of Payment Methods?

What country and currency are you including? Would love to try and recreate your response.

Here’s what I got from just the checkout page.
// Request URL: POST https://sandboxapi.rapyd.net/v1/checkout

Request

{
    "amount": 425.00,
    "complete_payment_url": "http://example.com/complete",
    "country": "GB",
    "currency": "GBP",
    "customer": "cus_77ebe87010ab257134948171c16a2190",
    "error_payment_url": "http://example.com/error",
    "merchant_reference_id": "950ae8c6-78",
    "cardholder_preferred_currency": true,
    "language": "en",
    "metadata": {
        "merchant_defined": true
    },
    "payment_method_types_include": [
      
    ],
     "payment_method_type_categories": [
      "card",
      "bank_redirect"
    ],
    "expiration": 1672279867,
    "payment_method_types_exclude": [],
      "custom_elements": {

         "save_card_default":true

      }
}

Response

{
    "status": {
        "error_code": "",
        "status": "SUCCESS",
        "message": "",
        "response_code": "",
        "operation_id": "f6a5e5c5-b1f7-4f9d-9779-f073861cd52b"
    },
    "data": {
        "id": "checkout_72a4f630cda5c343f1621a7573565505",
        "status": "NEW",
        "language": "en",
        "merchant_color": "323fff",
        "merchant_logo": null,
        "merchant_website": "http://rapyd.net",
        "merchant_customer_support": {
            "url": "http://support.rapyd.net",
            "email": "support@rapyd.net",
            "phone_number": "555-555-5555"
        },
        "merchant_alias": "Test Business",
        "merchant_terms": null,
        "merchant_privacy_policy": null,
        "page_expiration": 1657563096,
        "redirect_url": "https://sandboxcheckout.rapyd.net?token=checkout_72a4f630cda5c343f1621a7573565505",
        "merchant_main_button": "pay_now",
        "cancel_checkout_url": "http://rapyd.net",
        "complete_checkout_url": "http://rapyd.net",
        "country": "GB",
        "currency": "GBP",
        "amount": 425,
        "payment": {
            "id": null,
            "amount": 425,
            "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_77ebe87010ab257134948171c16a2190",
            "payment_method": null,
            "payment_method_data": {},
            "expiration": 1672279867,
            "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": "customer_present",
            "mid": null,
            "next_action": "not_applicable"
        },
        "payment_method_type": null,
        "payment_method_type_categories": [
            "card",
            "bank_redirect"
        ],
        "payment_method_types_include": [],
        "payment_method_types_exclude": [],
        "customer": "cus_77ebe87010ab257134948171c16a2190",
        "custom_elements": {
            "save_card_default": true,
            "display_description": false,
            "payment_fees_display": true,
            "merchant_currency_only": false,
            "billing_address_collect": false,
            "dynamic_currency_conversion": false
        },
        "timestamp": 1656353496,
        "payment_expiration": null,
        "cart_items": [],
        "escrow": null,
        "escrow_release_days": null
    }
}

Page Example
checkout-page-categories

1 Like

Hello @Community_Team , thanks for the detailed solution.

Though this solution works ONLY for the checkout implementation. If you use the Toolkit the same exact code will provide a different output.

Specifically:

"payment_method_type_categories": [
      "card",
      "bank_redirect"
    ],

This will show only Card payment.

"payment_method_type_categories": [
      "bank_redirect",
      "card"
    ],

This will show only bank_redirect payment.

It’s weird but that’s what it actually happens.
It seems to me there has to be some difference on how the library handles Checkout integration and Toolkit.

Hi @salvosav

Yes, with the toolkit you are allowed to use only one payment method type category. This is the design:

You need to specify one payment method type category in Create Checkout request, or alternatively, one payment method type or one list of payment method types of the same category.

The paragraph above is written in the following documentation:

2 Likes

Hello @Community_Team ,
thanks for the reference.
I had read that part and intented as: to filter: specify one.
I got even more on the wrong direction because you can completely skip these parameteres (not declaring them at all) and it will just load cards payment.

Anyway I’ve changed my implementation to directly init 2 different checkouts and show both of them to the user under 2 different tabs: card & bank.

1 Like