How to remove Upi(External wallet) from Razorpay - FLUTTER - flutter

I am using Razorpay for the payment in an e- commerce app, Actually in only need card payment in the payment method of razorpay. But how can i remove all the external payment from the options.

You can configure the payment methods of your choice on the Checkout section of the Payment Links to provide a highly personalized experience for your customers.
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
-X POST https://api.razorpay.com/v1/payment_links/ \
-H 'Content-type: application/json' \
-d '{
"amount": 1000,
"currency": "INR",
"accept_partial": true,
"first_min_partial_amount": 100,
"reference_id": "#523442",
"description": "Payment for policy no #23456",
"customer": {
"name": "Gaurav Kumar",
"contact": "+919999999999",
"email": "gaurav.kumar#example.com"
},
"notify": {
"sms": true,
"email": true
},
"reminder_enable": true,
"options": {
"checkout": {
"method": {
//here you have to specify
"netbanking": "1",
"card": "1",
"upi": "0",
"wallet": "0"
}
}
}
}'
Edit
official docs: https://razorpay.com/docs/payments/payment-methods/

Related

Charge tax using PayPal Subscriptions API

As an EU based seller I need to charge tax based on customer country tax rates and rules. That means that when I create subscription I need to specify either tax rate (percentage or amount) or have the ability to override subscription price. When using Stripe one just needs to specify tax_percent beside plan_id when creating subscription.
So far I wasn't able to do the same using PayPal Subscriptions API and their smart buttons. Tax rate can be set when creating plan but I need to be able to set tax percentage per subscription.
Sample smart button JS code:
paypal.Buttons({
createSubscription: function(data, actions) {
return actions.subscription.create({
'plan_id': 'P-2UF78835G6983425GLSM44MA',
// I'd like to be able to set tax rate here somehow
});
}
}).render('#paypal-button-container');
No luck setting up tax directly using Subscriptions API either:
curl -v -k -X POST https://api.sandbox.paypal.com/v1/billing/subscriptions \
-H "Accept: application/json" \
-H "Authorization: Bearer Access-Token" \
-H "Content-Type: application/json" \
-d '{
"plan_id": "P-2UF78835G6983425GLSM44MA",
"application_context": {
"brand_name": "example",
"user_action": "SUBSCRIBE_NOW",
"payment_method": {
"payer_selected": "PAYPAL",
"payee_preferred": "IMMEDIATE_PAYMENT_REQUIRED"
},
"return_url": "https://example.com/returnUrl",
"cancel_url": "https://example.com/cancelUrl"
}
}'
Am I missing something, thinking about this incorrectly or did PayPal "forgot" to implement basic thing like tax rate and therefore make their new subscriptions API unusable for VAT MOSS scenarios?
You can add the tax override to the plan node as shown below
<script>
paypal.Buttons({
createSubscription: function(data, actions) {
return actions.subscription.create({
'plan_id': 'YOUR_PLAN_ID_HERE', // Creates the subscription
'plan': {
'taxes': {
'percentage': '2.9',
'inclusive': false
}}
});
},
onApprove: function(data, actions) {
alert('You have successfully created subscription ' + data.subscriptionID); // Optional message given to subscriber
}
}).render('#paypal-button-container'); // Renders the PayPal button
</script>
It's an old topic and still not possible. PayPal doesn't support taxes with subscriptions. You can price your subscription so it has the VAT included in it. Mention that the price includes VAT before a user is redirected to payment.
I highly recommend not to implement the tax rules yourself. Better let a 3rd party API handle correct calculations.
https://vatstack.com/rates
https://quaderno.io/checkout
https://www.octobat.com/products/vat-gst-sales-tax-engine
Recently I found out that this is possible. Not sure if this is something added fairly recently or was this option there all along.
While creating a subscription you can override a plan and set the tax percentage inline.
curl -v -k -X POST https://api.sandbox.paypal.com/v1/billing/subscriptions \
-H "Accept: application/json" \
-H "Authorization: Bearer Access-Token" \
-H "Content-Type: application/json" \
-d '{
"plan_id": "#PLANID",
...
"plan": {
"taxes": {
"percentage": "19",
"inclusive": false
}
}
}'
Taxes seem to be included in the Plan entity.
https://developer.paypal.com/docs/subscriptions/full-integration/plan-management/#show-plan-details
curl -v -X GET https://api-m.sandbox.paypal.com/v1/billing/plans/P-2UF78835G6983425GLSM44MA \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <Access-Token>
{
"id": "P-2UF78835G6983425GLSM44MA",
"product_id": "PROD-6XB24663H4094933M",
"name": "Basic Plan",
"status": "ACTIVE",
"description": "Basic plan",
"billing_cycles": [
{
"frequency": {
"interval_unit": "MONTH",
"interval_count": 1
},
"tenure_type": "TRIAL",
"sequence": 1,
"total_cycles": 1
},
{
"pricing_scheme": {
"fixed_price": {
"currency_code": "USD",
"value": "10.0"
}
},
"frequency": {
"interval_unit": "MONTH",
"interval_count": 1
},
"tenure_type": "REGULAR",
"sequence": 2,
"total_cycles": 12
}
],
"payment_preferences": {
"auto_bill_outstanding": true,
"setup_fee": {
"currency_code": "USD",
"value": "10.0"
},
"setup_fee_failure_action": "CONTINUE",
"payment_failure_threshold": 3
},
----------------------------------------
"taxes": {
"percentage": "10.0",
"inclusive": false
},
----------------------------------------
"quantity_supported": false,
"create_time": "2020-02-26T07:01:04Z",
"update_time": "2020-02-26T07:01:04Z",
"links": [
{
"href": "https://api-m.sandbox.paypal.com/v1/billing/plans/P-2UF78835G6983425GLSM44MA",
"rel": "self",
"method": "GET"
},
{
"href": "https://api-m.sandbox.paypal.com/v1/billing/plans/P-2UF78835G6983425GLSM44MA",
"rel": "edit",
"method": "PATCH"
},
{
"href": "https://api-m.sandbox.paypal.com/v1/billing/plans/P-2UF78835G6983425GLSM44MA/deactivate",
"rel": "self",
"method": "POST"
}
]
}

PAYPAL Identity API don't send account_type attribute

I have registered a new app in PayPal sandbox and give permission to get account_type
Paypal app permissions
I do the next curl request
curl -v -X GET https://api.sandbox.paypal.com/v1/oauth2/token/userinfo?schema=openid \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {my_access_token}"
And I don't receive any account attributes in response:
The fields that I have received:
{
"user_id": "https://www.paypal.com/webapps/auth/identity/user/i-78126398172639182kjhgadkgdsk",
"name": "Ivan Ivanov",
"middle_name": "",
"email": "mi****#gmail.com",
"verified": "false",
"birthday": "11111111",
"locale": "en_US",
"payer_id": "5555ddddd",
"address": {
"postal_code": "111111",
"country": "US",
"state": "AL",
"street1": "NNNN",
"street2": "",
"city": "NNN"
},
"language": "en_US",
"verified_account": "false",
"birthdate": "1111111",
"email_verified": "false"
}
What I do wrong? Or PayPal REST SDK has some issue with it?
Thanks

FIWARE Orion: return subscription id

When creating a subscription, it would be nice to return the subscription ID.
For instance, the following code doesn't return anything :
curl localhost:1026/v2/subscriptions -s -S --header 'Content-Type: application/json' \
-d #- <<EOF
{
"description": "A subscription to get info about Room1",
"subject": {
"entities": [
{
"id": "Room1",
"type": "Room"
}
],
"condition": {
"attrs": [
"pressure"
]
}
},
"notification": {
"http": {
"url": "http://localhost:1028/accumulate"
},
"attrs": [
"temperature"
]
},
"expires": "2040-01-01T14:00:00.00Z",
"throttling": 5
}
EOF
In the subscription case, the resource id is generated server-side (with difference to the entities endpoint, where the id is decided client-side).
It would be nice to return it in the POST call, is there any way to do this?
Subscription ID is retrieved in Location header in the response to the subscription creation request, eg:
Location: /v2/subscriptions/5b991dfa12f473cee6651a1a
More details in the NGSIv2 API specification (check "Create Subscription" section).

PayPal Billing Plan doesn't allow users to use PayPal balance

I setup a PayPal plan with a trialing period of 1 month.
When users sign-up for the Billing Agreement, they are unable to use their PayPal balance.
Is there any reason why that would happen? I read on one forum that PayPal may force users to use a card or bank account when the Billing Plan is setup incorrectly, however I don't think that is the case.
My REST call to setup the plan:
curl -v -X POST https://api.paypal.com/v1/payments/billing-plans/ \
-H "Content-Type:application/json" \
-H "Authorization: Bearer <Access Key>" \
-d '{
"name": "Plan",
"description": "Plan desc",
"type": "FIXED",
"payment_definitions": [
{
"name": "Regular payment definition",
"type": "REGULAR",
"frequency": "MONTH",
"frequency_interval": "1",
"amount": {
"value": "45",
"currency": "USD"
},
"cycles": "12",
"charge_models": [
]
},
{
"name": "Trial payment definition",
"type": "TRIAL",
"frequency": "MONTH",
"frequency_interval": "1",
"amount": {
"value": "0",
"currency": "USD"
},
"cycles": "1",
"charge_models": [
]
}
],
"merchant_preferences": {
"return_url": "http://www.paypal.com",
"cancel_url": "http://www.paypal.com/cancel",
"auto_bill_amount": "YES",
"initial_fail_amount_action": "CANCEL",
"max_fail_attempts": "0"
}
}'
Any help or insight would be greatly appreciated.
Thanks!
Talked to PayPal support.
Turns out this is intended behavior. To protect the merchants PayPal requires customers to have at least one additional payment method other than their PayPal Balance.
Therefore, if they do not they cannot subscribe. However, one thing I'd like to mention is that even though they require this, according to the representative, the PayPal Balance will always be used first.

PayPal recurring payments: How to add initial payment.

I have been using implementing a function that use can do recurring payments using PayPal with this request (copied from https://developer.paypal.com/webapps/developer/docs/api/#create-a-plan)
curl -v POST https://api.sandbox.paypal.com/v1/payments/billing-plans \
-H 'Content-Type:application/json' \
-H 'Authorization: Bearer <Access-Token>' \
-d '{
"name": "T-Shirt of the Month Club Plan",
"description": "Template creation.",
"type": "fixed",
"payment_definitions": [
{
"name": "Regular Payments",
"type": "REGULAR",
"frequency": "MONTH",
"frequency_interval": "2",
"amount": {
"value": "100",
"currency": "USD"
},
"cycles": "12",
"charge_models": [
{
"type": "SHIPPING",
"amount": {
"value": "10",
"currency": "USD"
}
},
{
"type": "TAX",
"amount": {
"value": "12",
"currency": "USD"
}
}
]
}
],
"merchant_preferences": {
"setup_fee": {
"value": "1",
"currency": "USD"
},
"return_url": "http://www.return.com",
"cancel_url": "http://www.cancel.com",
"auto_bill_amount": "YES",
"initial_fail_amount_action": "CONTINUE",
"max_fail_attempts": "0"
}
}'
the above request will create regular recurring payment. I want to add initial payment to the request above. I found a way with Classic API as in https://developer.paypal.com/docs/classic/paypal-payments-pro/integration-guide/WPRecurringPayments/ Specifying an Initial Payment part. However I could not find a way to add initial payment using REST API. Thanks!
Hey this is avi from PayPal here. The setup_fee under the merchant_preferences section for rest billing plans corresponds to the initial payment for recurring payments in the classic api. That fee is charged only once when after user consents to billing plan to form billing agreement.