How to integrate PhonePe in iOS?

236 views Asked by At

I tried integrating Phonepe Payment sdk in flutter app and it's working well in android but in iOS I am getting PhonePePayment.HTTPClientError error 0 How do I solve this? Has anyone done this? Any solutions?

I included package: phonepe_payment_sdk: ^1.0.4

added this in my info.plist:

<key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLName</key>
            <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>amzn-$(PRODUCT_BUNDLE_IDENTIFIER)</string>
                <string>juspay-$(PRODUCT_BUNDLE_IDENTIFIER)</string>
                <string>$(PRODUCT_BUNDLE_IDENTIFIER).cred</string>
                <string>paytm-$(PRODUCT_BUNDLE_IDENTIFIER)</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleURLName</key>
            <string>com.PhonePe-iOS-Intent-SDK-Integration</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>iOSIntentIntegration</string>
            </array>
        </dict>
    </array>
    <key>CFBundleVersion</key>
    <string>$(FLUTTER_BUILD_NUMBER)</string>
    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>ppemerchantsdkv1</string>
        <string>ppemerchantsdkv2</string>
        <string>ppemerchantsdkv3</string>
        <string>paytmmp</string>
        <string>gpay</string>
        <string>credpay</string>
        <string>phonepe</string>
        <string>tez</string>
        <string>paytm</string>
        <string>bhim</string>
        <string>devtools</string>
        <string>myairtel</string>
    </array>

This is the body I am passing to transaction api in base64:

 body = {
      "merchantId": merchantId,
      "merchantTransactionId": uuid.v1().toString().substring(0, 18),
      "merchantUserId": user.userId,
      "amount": amount * 100,
      "redirectUrl": "https://webhook.site/redirect-url",
      "redirectMode": "REDIRECT",
      "callbackUrl": callBackUrl,
      "mobileNumber": user.phoneNumber,
      "paymentInstrument": {
        "type": "PAY_PAGE",
      }
    };
0

There are 0 answers