So i've got this problem. Whenever i go to payment window i use:
Money money = new Money(basket.OrderTotal.Value, Currency.FirstOrDefault(x => x.ISOCode == "DKK"));
PaymentRequest request = new PaymentRequest(basket, selectedPaymentMethod, money);
selectedPaymentMethod.GetPaymentMethodService().RequestPayment(request);
This would create a new payment object every time i go to the window. In the case that a customer hits the back button in the browser, and click pay again, multiple payments for the basket is created.
How would i deal with this?
I guess i could just:
basket.ClearPayments();
Order would it be better to get the payement associated with the basket and use that?
if (basket.Payments.Any())
{
Payment payment = basket.Payments.First();
If you use the API that's what happens. uCommerce clears the existing payment with the same payment method and creates a new one with an all-new refernece id to avoid collisions on the remote end.
Dealing with payments
Hello.
So i've got this problem. Whenever i go to payment window i use:
This would create a new payment object every time i go to the window. In the case that a customer hits the back button in the browser, and click pay again, multiple payments for the basket is created.
How would i deal with this?
I guess i could just:
Order would it be better to get the payement associated with the basket and use that?
if (basket.Payments.Any()) { Payment payment = basket.Payments.First();
If you use the API that's what happens. uCommerce clears the existing payment with the same payment method and creates a new one with an all-new refernece id to avoid collisions on the remote end.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.