Multiple payments on an order

execv
Contributor
Contributor

In our checkout flow, we allow the user to submit partial payment for an order using store credit, if they have any. The problem we keep running into is that if a user applies partial payment on an order, the paypal integration breaks and we are given an items mismatched error (because the sum of all items does not equal the total). Here is an example:

 

Order #1: Total: $20

  • Item #1: $5
  • Item #2: $5
  • Item #3: $5
  • Item #4: $5

Custom pays $10 using store credit.

 

Customer tries to then pay the remaining balance of $10 via paypal, but it fails by receiving the items mismatched error. We send the item list to paypal with the cost of each item (which in this example totals $20), but the total for the order is set to $10. 

 

How can we let the paypal API know that a $10 payment has already been received so we don't get the mismatched items total error?

Login to Me Too
2 REPLIES 2

Kavyar
Moderator
Moderator

Good day @execv 

 

Thank you for posting to the PayPal community.

 

Yes, you can achieve this by passing the "final_capture" field as true when capturing the authorized payment.

 

To assist you further, I have provided a detailed guide which you can refer to. Please find the links below:

 

https://developer.paypal.com/docs/api/payments/v2/#authorizations_capture

 

https://developer.paypal.com/docs/api/payments/v2/#authorizations_capture!path=final_capture&t=reque...

 

PayPal system is a payment gateway, which will receive the payment request payload (i.e., Payment and Item details, Shipping details, Invoice number, Amount details etc.) from merchant websites(built via third party platforms eCommerce ) and process the payments accordingly.

 

Merchants should handle their internal website code and pass the appropriate payment API calls to PayPal system.

 

If the customer paid a total of $10 for 2 items using a stored card. To ensure a smooth transaction process, it is necessary to handle your website and remove the details of the item that has already been paid from the API call. After doing so, you can then pass the remaining item details and the corresponding amount value to the PayPal system.

 

Please ensure that the total for items should match correctly. Please visit the following link -https://developer.paypal.com/docs/api/orders/v2/#orders_create!path=purchase_units/amount&t=request

 

If your still facing issues, please create an MTS ticket via -  https://www.paypal-support.com/s/?language=en_US  with the detailed information and error details.

 

Sincerely,

Kavya

PayPal MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

Login to Me Too

execv
Contributor
Contributor

@Kavyar 

 

"If the customer paid a total of $10 for 2 items using a stored card. To ensure a smooth transaction process, it is necessary to handle your website and remove the details of the item that has already been paid from the API call. After doing so, you can then pass the remaining item details and the corresponding amount value to the PayPal system."

 

The discount will not always perfect match a set number of items. Let me briefly modify my example above:

 

Order #1: Total: $20

  • Item #1: $5
  • Item #2: $5
  • Item #3: $5
  • Item #4: $5

Custom pays $12 using store credit.

 

The customer has paid $12 using store credit. The customer still owes $8. How should this be handled with the PayPal API?

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.