razorpay / razorpay-pod

:iphone: CocoaPod implementation of Razorpay's Payment SDK. Refer for instructions:
https://docs.razorpay.com/v1/page/ios-integration
MIT License
21 stars 18 forks source link

Recurring Transactions Failure #215

Open iprabhakarpatil opened 2 days ago

iprabhakarpatil commented 2 days ago

Description

Recurring payment options fails to open the razorpay payment gateway. The RZP portal opens and auto closes with failure callback. the error code is 1. the message is Unexpected error occured. This is working fine in v1.3.7. But recently on upgrading the version to the latest (v1.3.10 or 1.3.11) the issue is observed.

Razorpay pod Version :

The issue is observed in below versions.

v1.3.10 & v1.3.11

Xcode Version :

Version 15.4 (15F31d)

What you did:

Try to make the payment for the recurring payments order

What happened:

code Int32 1 "Payment Failed - Unexpected Error"

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Create any order for recurring payments.
  2. Try to make the initial payment.

Suggested solution:

Expecting it to work as it is working in v1.3.7

Code example, screenshot, or link to a repository:

Please provide a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

vivekshindhe commented 2 days ago

@iprabhakarpatil Can you please share the payload where you are seeing this issue? Does it happen every time?

iprabhakarpatil commented 2 days ago

@vivekshindhe

yes it happens every time in v1.3.10 & 1.3.11 but works fine in 1.3.7

iprabhakarpatil commented 2 days ago
    func showPaymentForm() {
        var options: [String: Any] = [
            "currency": "INR",
            "description": checkoutData.description,
            "order_id": razorpayOrderId,
            "image": "",
            "name": "Product Name",
            "prefill": [
                "contact": contactNumber,
                "email": emailId
            ],
            "theme": [
                "color": "#008BD2"
            ],
            "config": [
                "display": [
                    "hide": [
                        [
                            "method": "wallet"
                        ]
                    ],
                    "preferences": [
                        "show_default_blocks": true
                    ]
                ]
            ]
        ]

        /// This is required to enable subscription in the Razorpay Gateway.
        if isRecurringPayment {
            options["recurring"] = true
        }

        if let customerId = checkoutData.customerId {
            options["customer_id"] = customerId
        }

        razorPayCheckout?.open(options, displayController: self)
    }

@vivekshindhe