question

wsadiq avatar image
wsadiq asked David Marginian Deactivated commented

Making multiple payments against an existing order using eCommerce api

Hello,


We are trying to make multiple payments against an existing order. We have our own digital giftcard system and when the customer wants to pay with the giftcard, we charge the giftcard externally and then simply add that payment using the end point merchants/<merchant id>/orders/<order id>/payments. This properly registers a payment against the order with the appropriate tender. Then we charge the remainder using eCommerce api using a stored credit card. For that we use the pay api /orders/<order id>/pay. In the payload we pass the amount we would like to charge. The problem is that eCommerce api charges the entire amount of the order, ignoring the requested amount. So in the end the order looks like this:


Subtotal : $16.98

Tax : $ 1.40

Total : $18.38


First payment: External Tender - Amount = $10.00 .

Second payment Stored credit card - Charge amount requested $8.38. Actual amount charged $18.38. The total of both payments made becomes $28.38 in this example.


So how can we use the pay api to pay only the remainder of the existing order?


Thanks for your help.


Paymentse-commerce api
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated commented

The ecommerce api does not currently allow you to apply an arbitrary amount toward an order.

6 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

wsadiq avatar image wsadiq commented ·

Hi David,


Thanks for the quick response. So would you suggest we handle the situation where they customer makes partial payment through a giftcard which is processed separately? We tried using charge api instead of pay api and that ends up creating a new order with a single custom item of the amount requested.


Thanks.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ wsadiq commented ·

Currently, I am not sure there is a solution. I pinged the ecomm team to see if they have some ideas.

0 Likes 0 ·
wsadiq avatar image wsadiq David Marginian ♦♦ commented ·

That would be great. This is a very real situation and without a solution for this scenario, we would either have to not support giftcard payments or go back to using payeezy and transarmor to make all payments externally - neither one is desirable.

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community