question

sreekant avatar image
sreekant asked David Marginian Deactivated commented

Using payment API for order payment but maximum time payment failed on first attempt.

Hi

I am using the below URL for making payment

https://apisandbox.dev.clover.com/v3/merchants/XXXXXXXX/orders/XXXXXXXXX/payments?access_token=XXXXXXXXXXXXX

But out of 10, 9 times payment failed showing API error. But after attempting again with a delay of 2 seconds it gets paid in the second or third attempt. I am using the emulator for performing payment in the Asynctask method.

I have 3 questions:

1-> I want to know why it is not getting paid on the very first attempt.?

2-> How can we find the payment status of an order if payment gets failed from API.?

3-> Can any order be paid two times? Because sometimes I found two transaction details in a single order in order application. Please check the image.device-2021-02-06-201739.png

Please answer my queries.

Thanks

Orderspaymentstate
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

That endpoint adds a payment record to an existing endpoint and is generally used by custom tenders, is that what you are doing, building a custom tender app? Yes, you can add multiple payments to an order. Are you making sure you are checking the response and making sure it was successful? Why isn't it working the first time? Difficult to say, what is your merchant id?

3 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.

sreekant avatar image sreekant commented ·

I attached a file where I put the code to make a payment API call. Please check and revert.

My merchant id is J5NBJXRB1DNZ8clover payment api.txt

0 Likes 0 ·
sreekant avatar image sreekant commented ·

API error : i am getting first time

"com.android.volley.ClientError"


i also followed below link to resolve but not worked:

https://github.com/google/volley/issues/278

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

I am not sure what is going on in your code, but it seems like you are just adding requests and not checking the response. I see several 404s in our server logs - rspBody="{\"details\":\"Order not found.\". When making a request, you need to make sure you get a valid response, you can't just assume the request was successful. If this code is running on a Clover device you shouldn't be using the create payments endpoint you should be creating a custom tender app - https://docs.clover.com/docs/creating-custom-tender-apps.

0 Likes 0 ·

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