I am trying to implement peer to peer transaction through PayPal. I am currently adding a feature where user can sell the goods from his account through my app to another user. For that the buyer has to pay online through PayPal to seller.
Scenario:
User A displays the item for sale. User B bids on it. User A accepts the bid. Now User B has to pay the said amount through PayPal so that User A can send his item to User B. Both users are normal users, they are not premium or business. The idea is to send money from B -> A in a decentralized way so that my server just know either the transaction is successful or not.
Questions:
Thanks in advance!
Using PayPal Checkout, be it with the web JS SDK, native SDK for iOS/Android, or v2/checkout/orders REST API alone, payments can be directed to a different destination account by including a payee
object in the purchase_units of the request.
Example
{
intent: 'CAPTURE',
purchase_units: [{
amount: {
currency_code: 'USD',
value: '220.00'
},
payee: {
email_address: '[email protected]'
}
}]
}
After payer approval, capture the order. The contents of the capture response object purchase_units[0].payments.captures[0]
will contain the PayPal transaction ID and indicate success or failure.