question

jevinkosasih avatar image
jevinkosasih asked jevinkosasih answered

Invalid payment when trying to create payment authorization

I want to create an authorization on a payment, which I have already created. Here is the response after I created the payment by sending a POST request to /v3/merchants/{mId}/orders/{orderId}/payments

                 
  1. {
  2. "tender": {
  3. "href": "https://sandbox.dev.clover.com/v3/merchants/G1PVG5TC9X0S1/tenders/HJGF4PFYWXK9T",
  4. "id": "HJGF4PFYWXK9T"
  5. },
  6. "result": "SUCCESS",
  7. "clientCreatedTime": 1658979308000,
  8. "modifiedTime": 1658979308000,
  9. "amount": 10000,
  10. "tipAmount": 500,
  11. "createdTime": 1658979308000,
  12. "id": "APZDBV7DH049R",
  13. "employee": {
  14. "id": "6XCRT98CMYTP0"
  15. },
  16. "order": {
  17. "id": "FWDW938RZ63P4"
  18. }
  19. }

Now I want to create an authorization on that payment by sending a POST request to /v3/merchants/{mId}/authorizations referencing the payment object I just made.

                 
  1. {
  2. "payment": {
  3. "tender": {
  4. "href": "https://sandbox.dev.clover.com/v3/merchants/G1PVG5TC9X0S1/tenders/HJGF4PFYWXK9T",
  5. "id": "HJGF4PFYWXK9T"
  6. },
  7. "result": "SUCCESS",
  8. "clientCreatedTime": 1658979308000,
  9. "modifiedTime": 1658979308000,
  10. "amount": 10000,
  11. "tipAmount": 500,
  12. "createdTime": 1658979308000,
  13. "id": "APZDBV7DH049R",
  14. "employee": {
  15. "id": "6XCRT98CMYTP0"
  16. },
  17. "order": {
  18. "id": "FWDW938RZ63P4"
  19. }
  20. },
  21. "amount": 20000,
  22. "type": "TAB"
  23. }

However, I am getting an invalid payment error. Does anyone know how to properly send an payment authorization request? I suspect that an issue is that my payment object has its "result" attribute set to "SUCCESS" when I probably want it to be "AUTH".

Payments
10 |2000

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

kevnat avatar image
kevnat answered jevinkosasih edited

Hi jevinkosasih,
How are you submitting the initial payment/auth? Please see below for some general rules for how to indicate the state of transactions and make sure you're attempting to adjust authorizations, not sales.

Open Authorizations are indicated as TYPE=PREAUTH. The value of RESULT transitions from AUTH to SUCCESS once captured or tip adjusted. The dollar amount of open authorizations can also be incremented to authorize a different amount on the same record.

Sales in Clover are considered final payments, and cannot be tip-adjusted, incremented, or captured; they're captured and sent for clearing automatically. Sales are indicated as TYPE=AUTH, and also will have RESULT= SUCESS and STATE=CLOSED properties.

Thanks,

Kevin

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

kevnat avatar image kevnat commented ·
0 Likes 0 ·
jevinkosasih avatar image jevinkosasih commented ·

I sent a POST request to https://sandbox.dev.clover.com/v3/merchants/{mId}/orders/{orderId}/payments, with the following body:

{
  "tender": {
    "id": "T5AQJKRC00FBJ"
  },
  "amount": 0,
  "result": "AUTH",
  "cardTransaction": {
    "type": "PREAUTH",
    "cardType": "VISA",
    "entryType": "SWIPED",
    "first6": "1234",
    "last4": "4321"
  }
}

After this POST request, the "result" immediately changes to "SUCCESS". Am I doing something wrong? Can't I make an order payment into an authorization? Do you have a sample request that keeps the result at "AUTH", so that I can adjust authorizations at /v3/merchants/{mId}/authorizations. Right now, if I use the payment that I created, and send a POST request to https://sandbox.dev.clover.com/v3/merchants/{mId}/authorizations with this body, I get an invalid payment error

{
    "payment": {
        "id": "AQTP4X8CNM3KY"
    },
    "type": "TAB",
    "amount": 1000
}
0 Likes 0 ·
jevinkosasih avatar image
jevinkosasih answered

I found the problem. Clover only allows authorizations on payments that use the credit/debit tender. However, as of right now, Clover does not support the creation of credit/debit payments via their REST API. You can see the unsupported error by creating a POST request to /v3/merchants/{mId}/orders while using the tender id of the credit/debit tenders.

10 |2000

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

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