I am creating a project where i am creating an recycler application, in react and python django rest framework and i am creating a wallet where all the sold items amount will be credited in users wallet and the user can transfer the wallet amount to his bank account.
the problem which i am getting in phonepe API is i am getting an option to transfer money from users account to merchant account and i want to transfer money from merchant account to users account.
the code is there in python django rest framework.
I tried to use the refund api but the api needs the transaction id which was initiated at the payment time, but it is not possible.
Now i am thinking a new approach to make user as a receiver and merchant as a payer using a post api of phonepe, and the json provided be as follows
{
"merchantId": "MERCHANTUAT",
"merchantTransactionId": "MT7850590068188104",
"merchantUserId": "MU933037302229373",
"amount": 10000,
"callbackUrl": "https://webhook.site/callback-url",
"mobileNumber": "9999999999",
"deviceContext": {
"deviceOS": "ANDROID"
},
"paymentInstrument": {
"type": "UPI_INTENT",
"targetApp": "com.phonepe.app",
"accountConstraints": [{ //Optional. Required only for TPV Flow.
"accountNumber": "420200001892",// this should fixed as of merchant details
"ifsc": "ICIC0000041"
}]
}
}
this should fixed as of merchant details
"accountNumber": "420200001892",
"ifsc": "ICIC0000041"
and in the merchant id should be upi id of user
is there any way to transfer using some other gateway?
The answer for this query is phonepay does not provides an api to pay back to user as we can say to pay from wallet to upi as paytm and razorpay provides that api but phonepay is a good option to use into website as it is free. but while talking about paytm and razorpay they took 2% of commission.