razorpay / razorpay-flutter

Razorpay Flutter Plugin
MIT License
106 stars 147 forks source link

Hide Prefill email and prefill contact data - not working #262

Open mpnihad opened 2 years ago

mpnihad commented 2 years ago

We are sending prefilled data in options. we need to hide the prefilled - contact and email data. Please find the below code how i have integrated. Please correct me if i have done anything wrong

  var options = {
    'key': 'API Key',
    'amount': amount,
    'name': 'Name',
    'description': 'description value',
    "hidden": {"contact": true, "email": false},
    "config": {
      "display": {
        //this will allow us to hide certain types of payment 
        "hide": [{method: paylater}, {method: emi}],
        "preferences": {
          "show_default_blocks": "true",
        },
      },
    },
    'prefill': {'contact': '9999999999', 'email': 'email@gmail.com'}
  };

  try {
    _razorpay.open(options);
  } catch (e) {
    debugPrint('Error: e');
  }

Also tried : 'hidden': {'contact': true, 'email': false} 'hidden': {'contact': 1, 'email': 0}

Also tried adding the "hidden" payload after the prefill - Still not working

mpnihad commented 2 years ago

Please find the document i used to create the above Razorpay Payload https://razorpay.com/docs/payments/payment-gateway/flutter-integration/standard/build-integration#17-add-checkout-options

below is the description shown in that page to hide the contact and email

Screenshot 2022-08-12 at 10 07 14 PM

sarankumar-ns commented 1 year ago

I'm also facing the same problem.