question

chrisrossi avatar image
chrisrossi asked arvi commented

Create payments for testing

Hi I'm working on a web application that makes use of the REST API. For this we'll be grabbing payments for a merchant and doing some computations with them. For development and testing I'd like to be able to add some payments to my test merchant but I'm not sure the best way to go about this.

I've tried creating an 'order' using the CreateOrder endpoint, including a payment, but they don't seem to show up when I GET payments. The CreateOrder endpoint, of course, has a body the size of the phone book and there's no real indication of what is required and what all of it is for, so I've tried to stick to the minimum necessary. I get back a response that indicates the order was created without any trouble, but, again, I don't see any payments.

Any advice on the quickest way to get some payments created for my test merchant just so I can do some testing is greatly appreciated.

Thanks!

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

Jacob Abrams avatar image
Jacob Abrams answered arvi commented

You need to make two calls, the first you figured correctly is to create an order, the second is to make a payment for that order. This answer should help:

http://devask.clover.com/question/159...

You may also need to change the state of the order in a third call after the payment, valid values for order state are: OPEN | PAID | REFUNDED | CREDITED | PARTIALLY PAID | PARTIALLY REFUNDED | MANUALLY REFUNDED

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.

chrisrossi avatar image chrisrossi commented ·

Ok, when I attempt to create a payment, I'm getting back the error message: "Payment must define a valid tender id"

The documentation for the endpoint doesn't indicate any required fields and it's not obvious which piece in the schema is the "tender id". Any notion?

Thanks!

0 Likes 0 ·
chrisrossi avatar image chrisrossi commented ·

Ok, got it. I had to do a GET /v3/merchants/{mId}/tenders to get a list of tenders, pick one, and use it for the payment. The documentation claims this isn't required, but it is. But working now, thanks.

0 Likes 0 ·
arvi avatar image arvi chrisrossi commented ·

@chrisrossi How did you pass tender id for payment? Below is my url.

https://apisandbox.dev.clover.com/v3/merchants/$merchant_id/orders/$order/payments?access_token=$access_token
0 Likes 0 ·

Welcome to the
Clover Developer Community