Open ErezShahaf opened 4 years ago
Solved:
<PayPalButton amount={this.props.details.totalAmount} shippingPreference="NO_SHIPPING" onApprove={(data, actions) => { actions.order.capture().then(() => { this.props.handlePaymentComplete(data.orderID); }); }} options={{ clientId: clientId, }} />
Should have waited for actions.order.capture to end.
This is how I load my button
handlePaymentComplete - sends a request to ther back-end which then saves information to DB and validates the order.
This code seems to be working in sandbox, it shows the payment complete message, I can send a request with the orderId to paypal's api and get all the information about the transaction, the payment is in approved status, but the money won't be tranfered.
I have tried to change to live paypal, paid through my cc to my paypal seller account, my cc company sends to me an SMS about the transaction so it seems like it is doing something, the request to paypal's API says everything is ok:
But,once again the payment won't actually be transferred.
I have checked the internet for answers, but couldn't find anything besides deprecated paypal versions where you had to call some kind of expressCheckout command in order to finish the transaction, so I guess the solution is something similar to that idea, but I couldn't find it.
What I have already tried to do, but did not affect anything, is to use the action.order.capture: