Highlight Walnut 369 on Checkout

Configure Walnut 369 as a payment method on Razorpay Checkout.


Once the feature is enabled, Walnut 369 appears as a cardless EMI provider under EMI on the Razorpay Standard Checkout. Using our configuration, you can highlight Walnut 369 on the Razorpay Checkout.

Steps🔗

Follow these steps to highlight Walnut 369 on Razorpay Checkout:

  1. Configure the payment methods.
  2. Build the configuration.

1. Configure Payment Methods🔗

Depending on how you want to control the payment methods at the Checkout, there are two different ways in which the configuration can be passed to the Checkout:

  • Method 1: Pass the configuration to the options parameter of the Checkout code at run time.
    This is useful when you want to modify the order of the payment methods for a particular set of payments while rendering the Checkout. See the sample code for details.

  • Method 2: Create a global setting of the payments as a Configuration ID.
    This is useful when you want to fix the order of the payment methods on all the instances of Checkout.

    Attention Plugin Users
    If you are using one of our plugins to accept payments, you can highlight Walnut 369 on Checkout only by creating a global setting of the payments as a Configuration ID and contact the Support Team for more details on the Configuration ID. Contact our Support Team for more details about the Configuration ID

2. Build the Configuration🔗

Using the display config, you can put together all the modules, that is, blocks, sequence, preferences, hide instruments as shown below:

You can pass the display config in the Checkout options or the Orders API request using the checkout_config_id parameter.

Copylet config = { display: { blocks: { walnutBlock: { name: "Pay with Walnut 369", // The title of the block instruments: [{ "method": "cardless_emi", "providers": ["walnut369"] }] // The list of instruments }, }, sequence: ["block.walnutBlock"], // The sequence in which blocks and methods should be shown preferences: { show_default_blocks: true // Should Checkout show its default blocks? } } };
Copy// beginning of the Checkout code ..... let options = { key: "[YOUR_KEY_ID]", amount: 60000, currency: "INR", config: { display: { blocks: { walnutBlock: { name: "Pay with Walnut 369", // The title of the block instruments: [{ "method": "cardless_emi", "providers": ["walnut369"] }] // The list of instruments }, }, sequence: ["block.walnutBlock"], // The sequence in which blocks and methods should be shown preferences: { show_default_blocks: true // Should Checkout show its default blocks? } } } }; let razorpay = new Razorpay(options); razorpay.open(); .... //rest of the Checkout code
Copy//Contact our Support Team to get your `checkout_config_id` parameter. curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \ -X POST https://api.razorpay.com/v1/orders \ -H "content-type: application/json" \ -d '{ "amount": 50000, "currency": "INR", "receipt": "receipt#1", "checkout_config_id": "config_Ep0eOCwdSfgkco", "notes": { "reference_no": "IBFA10106201500002" } }'
CopyRazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]"); JSONObject orderRequest = new JSONObject(); orderRequest.put("amount", 1000); // amount in the smallest currency unit orderRequest.put("currency", "INR"); orderRequest.put("checkout_config_id", "config_Ep0eOCwdSfgkco"); Order order = razorpayclient.orders.create(orderRequest); System.out.print(order);
Copy import razorpay client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET")) client.order.create({ "amount": 50000, "currency": "INR", "receipt": "receipt#1", "checkout_config_id": "config_Ep0eOCwdSfgkco" })
Copy$api = new Api($key_id, $secret); $api->order->create(array('amount' => 100, 'currency' => 'INR', checkout_config_id=> 'config_Ep0eOCwdSfgkco'));
CopyRazorpayClient client = new RazorpayClient(your_key_id, your_secret); Dictionary<string, object> options = new Dictionary<string,object>(); options.Add("amount", 50000); // amount in the smallest currency unit options.Add("receipt", "receipt#1"); options.Add("currency", "INR"); options.Add("checkout_config_id", "config_Ep0eOCwdSfgkco"); Order order = client.Order.Create(options);
Copyrequire "razorpay" Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET') order = Razorpay::Order.create amount: 50000, currency: 'INR', receipt: 'receipt#1', checkout_config_id: 'config_Ep0eOCwdSfgkco'
Copyvar instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' }) instance.orders.create({ amount: 50000, currency: "INR", receipt: "receipt#1", checkout_config_id: "config_Ep0eOCwdSfgkco" })
Copyimport ( razorpay "github.com/razorpay/razorpay-go" ) client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET") data := map[string]interface{}{ "amount": 50000, "currency": "INR", "receipt": "receipt#1", "checkout_config_id": "config_Ep0eOCwdSfgkco" } body, err := client.Order.Create(data, nil)

Know more about Orders API.

Sample Code🔗

Given below is the sample code to highlight Walnut 369 on Standard Checkout.

Copy<html> <button id="rzp-button1">Pay</button> <script src="https://checkout.razorpay.com/v1/checkout.js"></script> <script> var options = { "key": " your key_id", // Enter the Key ID generated from the Dashboard "amount": "500000", // Amount is in currency subunits. Default currency is INR. Hence, 50000 refers to 50000 paise "currency": "INR", "name": "Acme Corp", "description": "Test Transaction", "image": "https://example.com/your_logo", // "order_id": "order_9A33XWu170gUtm", //This is a sample Order ID. Pass the `id` obtained in the response of Step 1 "handler": function (response){ alert(response.razorpay_payment_id); alert(response.razorpay_order_id); alert(response.razorpay_signature) }, "config": { "display": { "blocks": { "walnut": { "name": 'Pay via Walnut369', "instruments": [ { "method": 'cardless_emi', "providers":['walnut369'] } ], }, }, "sequence": ['block.walnut'], "preferences": { "show_default_blocks": false, }, }, }, "prefill": { "name": "Gaurav Kumar", "email": "gaurav.kumar@example.com", "contact": "9999999999" }, "notes": { "address": "Razorpay Corporate Office" }, "theme": { "color": "#3399CC" } }; var rzp1 = new Razorpay(options); rzp1.on('payment.failed', function (response){ alert(response.error.code); alert(response.error.description); alert(response.error.source); alert(response.error.step); alert(response.error.reason); alert(response.error.metadata.order_id); alert(response.error.metadata.payment_id); }); document.getElementById('rzp-button1').onclick = function(e){ rzp1.open(); e.preventDefault(); } </script> </html>
×