简体   繁体   中英

How to implement payment mechanism in mobile app using node js (server side)?

I am building rest api for a mobile application. Now, I need to implement payment mechanism similar to upwork payment where when the hirer post job, he or she makes payment and that is in hold. So, when the worker completes and hirer verifies it, only the payment is released to the worker.

I too went detail on stripe payment but found that it is for directly making payments to the party or verifying valid card. If stripe also supports above mechanism how can I implement?

The hirer should be able to make payment through Apple pay, Amex, VISA, Discover, MasterCard. Similarly, the worker should be able to receive payments once released.

How can i implement it?

You Need to implement Stripe Custom Connect in order to implement your requirement of holding payment and releasing on later stages. More Details on - https://stripe.com/docs/connect/custom-accounts

Its clear Connect is required - There are three types - Standard, Express, Custom

  • Standard - Direct transfer of payment. Not Customisable
  • Express - Somewhat customisable. Both the sender and receiver of money will have their own stripe dashboard and can take actions from there.
  • Custom - No stripe dashboard for sender or receiver. Have to be fully dependent on Backend Api calls. Only Stripe Admin account will be there.

Key thing to note on Custom Payments - When payment is done to a custom connect account, the money is transferred to receiver stripe account which you creates. Receiver do not have access to this stripe account. When your condition meets and need to transfer the payment, you need to use Payout Api to transfer the money from receiver stripe account to receiver Bank account. And Stripe has a timer going on if money is not PaidOut withing the specific timer, money will get refunded to the sender

Flow would be -

  • There will be two types of users on Stripe 1) Customers (Sender) Stripe have api to create them. Creating customer is easy no further steps are required. 2) Custom Account Holders (Receiver) Stripe have api to create them. Once the Receiver account is created Stripe needs some more info in order to verify the receiver and its necessary you provide them the details within some specific days otherwise this receiver will be blocked and not able to receive payments. This info is dependent country wise. Above Stripe link has more info regarding this.

  • Receiver must also add their bank accounts details in order to receive the payment. What data is needed for Bank Account is once again dependent on country of reciver. More details on stripe link.

  • Payment is made. Only few keys are needed to be added like the Receiver Custom Id in order to tell the stripe that its an custom payment.

  • Currently payment is in receiver stripe account once your condition is made you need to use Payout api of Stripe to transfer it to receiver bank Account.

  • Webhooks will play a very important roles you need to implement any webhook you think may happen in your case on top of my head like - Issue Raised by Sender or Receiver, Receiver account blocked, Payout done or failed.

Let me know if you need info in any of these steps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM