From c46ee6c505186aed217efb480f7337a131b828c4 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 29 Apr 2024 19:45:45 +0530 Subject: [PATCH 1/8] update payment --- documents/payment.md | 247 ++++++++++++++++++ lib/razorpay/payment.rb | 4 + .../fake_payment_expended_details.json | 38 +++ test/razorpay/test_payment.rb | 6 + 4 files changed, 295 insertions(+) create mode 100644 test/fixtures/fake_payment_expended_details.json diff --git a/documents/payment.md b/documents/payment.md index e1c0df84..5977cabe 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -863,6 +863,253 @@ Razorpay::Iin.fetch(tokenIin); } ``` ------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------------------------- + +### Fetch a Payment (With Expanded EMI Details) + +```rb +Razorpay::Payment.fetch("pay_XXXXXXXXXXXXXX").expendDetails({"expand[]": "emi"}) +``` + +**Parameters:** + +| Name | Type | Description | +|-------------|---------|------------------------------------------------------------------| +| paymentId* | integer | Unique identifier of the payment | +| expand[] | string | Use to expand the `emi` details when the payment method is emi. | + +**Response:**
+ +```json +{ + "id": "pay_DG4ZdRK8ZnXC3k", + "entity": "payment", + "amount": 200000, + "currency": "INR", + "status": "authorized", + "order_id": null, + "invoice_id": null, + "international": false, + "method": "emi", + "amount_refunded": 0, + "refund_status": null, + "captured": false, + "description": null, + "card_id": "card_DG4ZdUO3xABb20", + "bank": "ICIC", + "wallet": null, + "vpa": null, + "email": "gaurav@example.com", + "contact": "+919972000005", + "notes": [], + "fee": null, + "tax": null, + "error_code": null, + "error_description": null, + "error_source": null, + "error_step": null, + "error_reason": null, + "emi": { + "issuer": "ICIC", + "rate": 1300, + "duration": 6 + }, + "acquirer_data": { + "auth_code": "828553" + }, + "created_at": 1568026077 +} +``` +------------------------------------------------------------------------------------------------------- + +### Fetch a Payment (With Expanded Card Details) + +```rb +Razorpay::Payment.fetch("pay_XXXXXXXXXXXXXX").expendDetails({"expand[]": "card"}) +``` + +**Parameters:** + +| Name | Type | Description | +|-------------|---------|---------------------------------------------------------------------| +| paymentId* | integer | Unique identifier of the payment | +| expand[] | string | Use to expand the card details when the payment method is `card`. | + +**Response:**
+ +```json +{ + "id": "pay_H9oR0gLCaVlV6m", + "entity": "payment", + "amount": 100, + "currency": "INR", + "status": "failed", + "order_id": "order_H9o58N6qmLYQKC", + "invoice_id": null, + "terminal_id": "term_G5kJnYM9GhhLYT", + "international": false, + "method": "card", + "amount_refunded": 0, + "refund_status": null, + "captured": false, + "description": null, + "card_id": "card_H9oR0ocen1cmZq", + "card": { + "id": "card_H9oR0ocen1cmZq", + "entity": "card", + "name": "Gaurav", + "last4": "1213", + "network": "RuPay", + "type": "credit", + "issuer": "UTIB", + "international": false, + "emi": false, + "sub_type": "business" + }, + "bank": null, + "wallet": null, + "vpa": null, + "email": "gaurav.kumar@example.com", + "contact": "+919000090000", + "notes": { + "email": "gaurav.kumar@example.com", + "phone": "09000090000" + }, + "fee": null, + "tax": null, + "error_code": "BAD_REQUEST_ERROR", + "error_description": "Card issuer is invalid", + "error_source": "customer", + "error_step": "payment_authentication", + "error_reason": "incorrect_card_details", + "acquirer_data": { + "auth_code": null, + "authentication_reference_number": "100222021120200000000742753928" + }, + "created_at": 1620807547 +} +``` + +------------------------------------------------------------------------------------------------------- + +### Fetch a Payment (With Expanded Offers Details) + +```rb +Razorpay::Payment.fetch("pay_XXXXXXXXXXXXXX").expendDetails({"expand[]": "offers"}) +``` + +**Parameters:** + +| Name | Type | Description | +|-------------|---------|----------------------------------------------------------------| +| paymentId* | integer | Unique identifier of the payment | +| expand[] | string | Use to expand the emi details when the payment method is emi. | + +**Response:**
+ +```json +{ + "id": "pay_DG4ZdRK8ZnXC3k", + "entity": "payment", + "amount": 200000, + "currency": "INR", + "status": "authorized", + "order_id": null, + "invoice_id": null, + "international": false, + "method": "emi", + "amount_refunded": 0, + "refund_status": null, + "captured": false, + "description": null, + "card_id": "card_DG4ZdUO3xABb20", + "bank": "ICIC", + "wallet": null, + "vpa": null, + "email": "gaurav@example.com", + "contact": "+919972000005", + "notes": [], + "fee": null, + "tax": null, + "error_code": null, + "error_description": null, + "error_source": null, + "error_step": null, + "error_reason": null, + "emi": { + "issuer": "ICIC", + "rate": 1300, + "duration": 6 + }, + "acquirer_data": { + "auth_code": "828553" + }, + "created_at": 1568026077 +} +``` + +------------------------------------------------------------------------------------------------------- + +### Fetch a Payment (With Expanded UPI Details) + +```rb +Razorpay::Payment.fetch("pay_XXXXXXXXXXXXXX").expendDetails({"expand[]": "upi"}) +``` + +**Parameters:** + +| Name | Type | Description | +|-------------|---------|--------------------------------------------------------------| +| paymentId* | integer | Unique identifier of the payment | +| expand[] | string | Use to expand the UPI details when the payment method is upi. | + +**Response:**
+ +```json +{ + "id": "pay_DG4ZdRK8ZnXC3k", + "entity": "payment", + "amount": 100, + "currency": "INR", + "status": "captured", + "order_id": "order_GjCr5oKh4AVC51", + "invoice_id": null, + "international": false, + "method": "upi", + "amount_refunded": 0, + "refund_status": null, + "captured": true, + "description": "Payment for Adidas shoes", + "card_id": null, + "bank": null, + "wallet": null, + "vpa": "gaurav.kumar@upi", + "email": "gaurav.kumar@example.com", + "contact": "9000090000", + "customer_id": "cust_K6fNE0WJZWGqtN", + "token_id": "token_KOdY$DBYQOv08n", + "notes": [], + "fee": 1, + "tax": 0, + "error_code": null, + "error_description": null, + "error_source": null, + "error_step": null, + "error_reason": null, + "acquirer_data": { + "rrn": "303107535132" + }, + "created_at": 1605871409, + "upi": { + "payer_account_type": "credit_card", + "vpa": "gaurav.kumar@upi", + "flow": "in_app" // appears only for Turbo UPI Payments. + } +} +``` + +------------------------------------------------------------------------------------------------------- + **PN: * indicates mandatory fields**

diff --git a/lib/razorpay/payment.rb b/lib/razorpay/payment.rb index d39f5a9d..e27d4906 100644 --- a/lib/razorpay/payment.rb +++ b/lib/razorpay/payment.rb @@ -112,5 +112,9 @@ def self.create_upi(data={}) def self.validate_vpa(data={}) request.post "validate/vpa" , data end + + def expendDetails(options={}) + self.class.request.get "#{id}", options + end end end diff --git a/test/fixtures/fake_payment_expended_details.json b/test/fixtures/fake_payment_expended_details.json new file mode 100644 index 00000000..63229f31 --- /dev/null +++ b/test/fixtures/fake_payment_expended_details.json @@ -0,0 +1,38 @@ +{ + "id": "fake_payment_id", + "entity": "payment", + "amount": 200000, + "currency": "INR", + "status": "authorized", + "order_id": null, + "invoice_id": null, + "international": false, + "method": "emi", + "amount_refunded": 0, + "refund_status": null, + "captured": false, + "description": null, + "card_id": "card_DG4ZdUO3xABb20", + "bank": "ICIC", + "wallet": null, + "vpa": null, + "email": "gaurav@example.com", + "contact": "+919972000005", + "notes": [], + "fee": null, + "tax": null, + "error_code": null, + "error_description": null, + "error_source": null, + "error_step": null, + "error_reason": null, + "emi": { + "issuer": "ICIC", + "rate": 1300, + "duration": 6 + }, + "acquirer_data": { + "auth_code": "828553" + }, + "created_at": 1568026077 + } diff --git a/test/razorpay/test_payment.rb b/test/razorpay/test_payment.rb index a071f853..7b82262d 100644 --- a/test/razorpay/test_payment.rb +++ b/test/razorpay/test_payment.rb @@ -298,6 +298,12 @@ def test_validate_vpa stub_post(%r{payments/validate/vpa$}, 'fake_validate_vpa',param_attr.to_json) payment = Razorpay::Payment.validate_vpa param_attr.to_json assert_equal param_attr[:vpa], payment.vpa + end + + def test_expendDetails + stub_get("#{BASE_URI}/v1/payments/#{@payment_id}/?expand[]=emi", 'fake_payment_expended_details') + payment = Razorpay::Payment.fetch(@payment_id).expendDetails + assert_equal @payment_id, payment.id end end end From 643619212b49a969df9fce7be471b72fb08df92c Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Wed, 15 May 2024 08:48:21 +0530 Subject: [PATCH 2/8] changes according to comment --- .../fake_payment_expended_details_card.json | 50 +++++++++++++++++++ test/razorpay/test_payment.rb | 10 +++- 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 test/fixtures/fake_payment_expended_details_card.json diff --git a/test/fixtures/fake_payment_expended_details_card.json b/test/fixtures/fake_payment_expended_details_card.json new file mode 100644 index 00000000..9f467834 --- /dev/null +++ b/test/fixtures/fake_payment_expended_details_card.json @@ -0,0 +1,50 @@ +{ + "id": "fake_payment_id", + "entity": "payment", + "amount": 100, + "currency": "INR", + "status": "failed", + "order_id": "order_H9o58N6qmLYQKC", + "invoice_id": null, + "terminal_id": "term_G5kJnYM9GhhLYT", + "international": false, + "method": "card", + "amount_refunded": 0, + "refund_status": null, + "captured": false, + "description": null, + "card_id": "card_H9oR0ocen1cmZq", + "card": { + "id": "card_H9oR0ocen1cmZq", + "entity": "card", + "name": "Gaurav", + "last4": "1213", + "network": "RuPay", + "type": "credit", + "issuer": "UTIB", + "international": false, + "emi": false, + "sub_type": "business" + }, + "bank": null, + "wallet": null, + "vpa": null, + "email": "gaurav.kumar@example.com", + "contact": "+919000090000", + "notes": { + "email": "gaurav.kumar@example.com", + "phone": "09000090000" + }, + "fee": null, + "tax": null, + "error_code": "BAD_REQUEST_ERROR", + "error_description": "Card issuer is invalid", + "error_source": "customer", + "error_step": "payment_authentication", + "error_reason": "incorrect_card_details", + "acquirer_data": { + "auth_code": null, + "authentication_reference_number": "100222021120200000000742753928" + }, + "created_at": 1620807547 + } \ No newline at end of file diff --git a/test/razorpay/test_payment.rb b/test/razorpay/test_payment.rb index 7b82262d..64dc0416 100644 --- a/test/razorpay/test_payment.rb +++ b/test/razorpay/test_payment.rb @@ -300,10 +300,16 @@ def test_validate_vpa assert_equal param_attr[:vpa], payment.vpa end - def test_expendDetails + def test_expendDetails_emi stub_get("#{BASE_URI}/v1/payments/#{@payment_id}/?expand[]=emi", 'fake_payment_expended_details') payment = Razorpay::Payment.fetch(@payment_id).expendDetails assert_equal @payment_id, payment.id - end + end + + def test_expendDetails_card + stub_get("#{BASE_URI}/v1/payments/#{@payment_id}/?expand[]=card", 'fake_payment_expended_details') + payment = Razorpay::Payment.fetch(@payment_id).expendDetails + assert_equal @payment_id, payment.id + end end end From 194133c37745638471ee96974647561b69d870d9 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 24 May 2024 09:48:23 +0530 Subject: [PATCH 3/8] added snakecase & failure test --- documents/payment.md | 62 +++++++++++++++++--------------- lib/razorpay/payment.rb | 6 ++-- test/fixtures/payment_error.json | 10 ++++++ test/razorpay/test_payment.rb | 18 +++++++--- 4 files changed, 61 insertions(+), 35 deletions(-) create mode 100644 test/fixtures/payment_error.json diff --git a/documents/payment.md b/documents/payment.md index 5977cabe..9787aef6 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -925,7 +925,7 @@ Razorpay::Payment.fetch("pay_XXXXXXXXXXXXXX").expendDetails({"expand[]": "emi"}) ### Fetch a Payment (With Expanded Card Details) ```rb -Razorpay::Payment.fetch("pay_XXXXXXXXXXXXXX").expendDetails({"expand[]": "card"}) +Razorpay::Payment.expend_details("pay_XXXXXXXXXXXXXX", {"expand[]": "card"}) ``` **Parameters:** @@ -995,7 +995,7 @@ Razorpay::Payment.fetch("pay_XXXXXXXXXXXXXX").expendDetails({"expand[]": "card"} ### Fetch a Payment (With Expanded Offers Details) ```rb -Razorpay::Payment.fetch("pay_XXXXXXXXXXXXXX").expendDetails({"expand[]": "offers"}) +Razorpay::Payment.expend_details("pay_XXXXXXXXXXXXXX", {"expand[]": "offers"}) ``` **Parameters:** @@ -1003,48 +1003,54 @@ Razorpay::Payment.fetch("pay_XXXXXXXXXXXXXX").expendDetails({"expand[]": "offers | Name | Type | Description | |-------------|---------|----------------------------------------------------------------| | paymentId* | integer | Unique identifier of the payment | -| expand[] | string | Use to expand the emi details when the payment method is emi. | +| expand[] | string | Use to expand the offers applied to a payment. | **Response:**
```json { - "id": "pay_DG4ZdRK8ZnXC3k", + "id": "pay_G8VaL2Z68LRtDs", "entity": "payment", - "amount": 200000, + "amount": 900, "currency": "INR", - "status": "authorized", - "order_id": null, + "status": "captured", + "order_id": "order_G8VXfKDWDEOHHd", "invoice_id": null, "international": false, - "method": "emi", + "method": "netbanking", "amount_refunded": 0, "refund_status": null, - "captured": false, - "description": null, - "card_id": "card_DG4ZdUO3xABb20", - "bank": "ICIC", + "captured": true, + "offers": { + "entity": "collection", + "count": 1, + "items": [ + { + "id": "offer_G8VXOp0qNuEXzh" + } + ] + }, + "description": "Purchase Shoes", + "card_id": null, + "bank": "KKBK", "wallet": null, "vpa": null, - "email": "gaurav@example.com", - "contact": "+919972000005", + "email": "gaurav.kumar@example.com", + "contact": "+919000090000", + "customer_id": "cust_DitrYCFtCIokBO", "notes": [], - "fee": null, - "tax": null, + "fee": 22, + "tax": 4, "error_code": null, "error_description": null, "error_source": null, "error_step": null, "error_reason": null, - "emi": { - "issuer": "ICIC", - "rate": 1300, - "duration": 6 - }, "acquirer_data": { - "auth_code": "828553" + "bank_transaction_id": "0125836177", + "authentication_reference_number": "100222021120200000000742753928" }, - "created_at": 1568026077 + "created_at": 1606985740 } ``` @@ -1053,15 +1059,15 @@ Razorpay::Payment.fetch("pay_XXXXXXXXXXXXXX").expendDetails({"expand[]": "offers ### Fetch a Payment (With Expanded UPI Details) ```rb -Razorpay::Payment.fetch("pay_XXXXXXXXXXXXXX").expendDetails({"expand[]": "upi"}) +Razorpay::Payment.expend_details("pay_XXXXXXXXXXXXXX", {"expand[]": "upi"}) ``` **Parameters:** -| Name | Type | Description | -|-------------|---------|--------------------------------------------------------------| -| paymentId* | integer | Unique identifier of the payment | -| expand[] | string | Use to expand the UPI details when the payment method is upi. | +| Name | Type | Description | +|-------------|---------|---------------------------------------------------------------| +| paymentId* | integer | Unique identifier of the payment | +| expand[] | string | Use to expand the UPI details when the payment method is upi. | **Response:**
diff --git a/lib/razorpay/payment.rb b/lib/razorpay/payment.rb index e27d4906..c12957f4 100644 --- a/lib/razorpay/payment.rb +++ b/lib/razorpay/payment.rb @@ -113,8 +113,8 @@ def self.validate_vpa(data={}) request.post "validate/vpa" , data end - def expendDetails(options={}) - self.class.request.get "#{id}", options - end + def self.expend_details(id, options={}) + request.get "#{id}", options + end end end diff --git a/test/fixtures/payment_error.json b/test/fixtures/payment_error.json new file mode 100644 index 00000000..ab33e9d3 --- /dev/null +++ b/test/fixtures/payment_error.json @@ -0,0 +1,10 @@ +{ + "error": { + "code": "BAD_REQUEST_ERROR", + "description": "The id provided does not exist", + "source": "business", + "step": "payment_initiation", + "reason": "input_validation_failed", + "metadata": {} + } +} \ No newline at end of file diff --git a/test/razorpay/test_payment.rb b/test/razorpay/test_payment.rb index 64dc0416..567a9cb7 100644 --- a/test/razorpay/test_payment.rb +++ b/test/razorpay/test_payment.rb @@ -300,16 +300,26 @@ def test_validate_vpa assert_equal param_attr[:vpa], payment.vpa end - def test_expendDetails_emi + def test_expend_details_emi stub_get("#{BASE_URI}/v1/payments/#{@payment_id}/?expand[]=emi", 'fake_payment_expended_details') - payment = Razorpay::Payment.fetch(@payment_id).expendDetails + payment = Razorpay::Payment.expend_details @payment_id assert_equal @payment_id, payment.id end - def test_expendDetails_card + def test_expend_details_card stub_get("#{BASE_URI}/v1/payments/#{@payment_id}/?expand[]=card", 'fake_payment_expended_details') - payment = Razorpay::Payment.fetch(@payment_id).expendDetails + payment = Razorpay::Payment.expend_details @payment_id assert_equal @payment_id, payment.id end + + def test_expend_details_failure + stub_get(%r{payments\/#{@payment_id}$}, 'payment_error') + assert_raises(Razorpay::Error) do + payment = Razorpay::Payment.expend_details(@payment_id) + if payment.error + raise Razorpay::Error.new, payment.error['code'] + end + end + end end end From ee8441e3c96301e2036b8e696c0650fb38a49991 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Fri, 24 May 2024 17:14:01 +0530 Subject: [PATCH 4/8] update doc --- documents/payment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/payment.md b/documents/payment.md index 9787aef6..d2b36a27 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -868,7 +868,7 @@ Razorpay::Iin.fetch(tokenIin); ### Fetch a Payment (With Expanded EMI Details) ```rb -Razorpay::Payment.fetch("pay_XXXXXXXXXXXXXX").expendDetails({"expand[]": "emi"}) +Razorpay::Payment.expendDetails("pay_XXXXXXXXXXXXXX",{"expand[]": "emi"}) ``` **Parameters:** From 3b7970eec50712e1eedec517c6252f47e682755d Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 27 May 2024 11:51:53 +0530 Subject: [PATCH 5/8] utypo correction --- lib/razorpay/payment.rb | 2 +- ...s.json => fake_payment_expanded_details.json} | 0 ...n => fake_payment_expanded_details_card.json} | 0 test/razorpay/test_payment.rb | 16 ++++++++-------- 4 files changed, 9 insertions(+), 9 deletions(-) rename test/fixtures/{fake_payment_expended_details.json => fake_payment_expanded_details.json} (100%) rename test/fixtures/{fake_payment_expended_details_card.json => fake_payment_expanded_details_card.json} (100%) diff --git a/lib/razorpay/payment.rb b/lib/razorpay/payment.rb index c12957f4..6185e1cf 100644 --- a/lib/razorpay/payment.rb +++ b/lib/razorpay/payment.rb @@ -113,7 +113,7 @@ def self.validate_vpa(data={}) request.post "validate/vpa" , data end - def self.expend_details(id, options={}) + def self.expand_details(id, options={}) request.get "#{id}", options end end diff --git a/test/fixtures/fake_payment_expended_details.json b/test/fixtures/fake_payment_expanded_details.json similarity index 100% rename from test/fixtures/fake_payment_expended_details.json rename to test/fixtures/fake_payment_expanded_details.json diff --git a/test/fixtures/fake_payment_expended_details_card.json b/test/fixtures/fake_payment_expanded_details_card.json similarity index 100% rename from test/fixtures/fake_payment_expended_details_card.json rename to test/fixtures/fake_payment_expanded_details_card.json diff --git a/test/razorpay/test_payment.rb b/test/razorpay/test_payment.rb index 567a9cb7..380c61d2 100644 --- a/test/razorpay/test_payment.rb +++ b/test/razorpay/test_payment.rb @@ -300,22 +300,22 @@ def test_validate_vpa assert_equal param_attr[:vpa], payment.vpa end - def test_expend_details_emi - stub_get("#{BASE_URI}/v1/payments/#{@payment_id}/?expand[]=emi", 'fake_payment_expended_details') - payment = Razorpay::Payment.expend_details @payment_id + def test_expand_details_emi + stub_get("#{BASE_URI}/v1/payments/#{@payment_id}/?expand[]=emi", 'fake_payment_expanded_details') + payment = Razorpay::Payment.expand_details @payment_id assert_equal @payment_id, payment.id end - def test_expend_details_card - stub_get("#{BASE_URI}/v1/payments/#{@payment_id}/?expand[]=card", 'fake_payment_expended_details') - payment = Razorpay::Payment.expend_details @payment_id + def test_expand_details_card + stub_get("#{BASE_URI}/v1/payments/#{@payment_id}/?expand[]=card", 'fake_payment_expanded_details') + payment = Razorpay::Payment.expand_details @payment_id assert_equal @payment_id, payment.id end - def test_expend_details_failure + def test_expand_details_failure stub_get(%r{payments\/#{@payment_id}$}, 'payment_error') assert_raises(Razorpay::Error) do - payment = Razorpay::Payment.expend_details(@payment_id) + payment = Razorpay::Payment.expand_details(@payment_id) if payment.error raise Razorpay::Error.new, payment.error['code'] end From 75f75c0c47024f5d3f52238453c0d964bc3f23be Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 27 May 2024 11:58:22 +0530 Subject: [PATCH 6/8] update doc --- documents/payment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/payment.md b/documents/payment.md index d2b36a27..173a80a3 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -1059,7 +1059,7 @@ Razorpay::Payment.expend_details("pay_XXXXXXXXXXXXXX", {"expand[]": "offers"}) ### Fetch a Payment (With Expanded UPI Details) ```rb -Razorpay::Payment.expend_details("pay_XXXXXXXXXXXXXX", {"expand[]": "upi"}) +Razorpay::Payment.expand_details("pay_XXXXXXXXXXXXXX", {"expand[]": "upi"}) ``` **Parameters:** From b7f55ecb3d4416f274f5a4b201f42f58317a07a2 Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 27 May 2024 12:02:44 +0530 Subject: [PATCH 7/8] update doc --- documents/payment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documents/payment.md b/documents/payment.md index 173a80a3..cee6435e 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -925,7 +925,7 @@ Razorpay::Payment.expendDetails("pay_XXXXXXXXXXXXXX",{"expand[]": "emi"}) ### Fetch a Payment (With Expanded Card Details) ```rb -Razorpay::Payment.expend_details("pay_XXXXXXXXXXXXXX", {"expand[]": "card"}) +Razorpay::Payment.expand_details("pay_XXXXXXXXXXXXXX", {"expand[]": "card"}) ``` **Parameters:** @@ -995,7 +995,7 @@ Razorpay::Payment.expend_details("pay_XXXXXXXXXXXXXX", {"expand[]": "card"}) ### Fetch a Payment (With Expanded Offers Details) ```rb -Razorpay::Payment.expend_details("pay_XXXXXXXXXXXXXX", {"expand[]": "offers"}) +Razorpay::Payment.expand_details("pay_XXXXXXXXXXXXXX", {"expand[]": "offers"}) ``` **Parameters:** From 4baba137cfd918b98d601eca7764e86267276e6f Mon Sep 17 00:00:00 2001 From: ankitdas13 Date: Mon, 27 May 2024 13:18:22 +0530 Subject: [PATCH 8/8] doc correction --- documents/payment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/payment.md b/documents/payment.md index cee6435e..4b1987ea 100644 --- a/documents/payment.md +++ b/documents/payment.md @@ -868,7 +868,7 @@ Razorpay::Iin.fetch(tokenIin); ### Fetch a Payment (With Expanded EMI Details) ```rb -Razorpay::Payment.expendDetails("pay_XXXXXXXXXXXXXX",{"expand[]": "emi"}) +Razorpay::Payment.expand_details("pay_XXXXXXXXXXXXXX",{"expand[]": "emi"}) ``` **Parameters:**