question

globaliwebsite avatar image
globaliwebsite asked ·

REST API - Card charge and order created order is not connected with paid id

Hello,


I am using rest api and perform following


1. Charge card -Perfect

2. Create Order - perfect


3. problem- when i go in sandbox dashboard it shows 3 records one for amount charged as paid and one record for order created. the status of order created is open when i click on Detail of order record it does not show the card payment associated with this


for tracking :


this is paid id on sandbox: ID: 7WKJPBJZRX22R

this is order id : 67XQQS9MC64TP



Please advice what i am missing


REST API
10 |2000 characters needed characters left characters exceeded

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

David Marginian avatar image
David Marginian answered ·

I am not sure how you are expecting the charge to be associated with the order you have created.

https://docs.clover.com/docs/ecommerce-accepting-payments

If there is no order associated with a payment, simply create a charge by sending a POST request to the /v1/charges endpoint. This is useful for scenarios such as recurring subscriptions.

You want to pay for an order, not make a charge, see: https://docs.clover.com/docs/ecommerce-accepting-payments#paying-for-an-order

Share
10 |2000 characters needed characters left characters exceeded

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

globaliwebsite avatar image
globaliwebsite answered ·

hello,


I am doing it like this



1. First i am charging Card thru this end point

string chargeUrl = String.Format("https://scl-sandbox.dev.clover.com/v1/charges";);


2. if charge is successfuly i am creating order thru this end point


string orderUrl = String.Format("https://scl-sandbox.dev.clover.com/v1/orders";);



3. when i check dashboard its create 2 records - seperately where as it should have one record order create and paid for same order


please advice what mistake i am doing

7 comments Share
10 |2000 characters needed characters left characters exceeded

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

No, it shouldn't have created one record. A charge is not to be used when you need to create a custom order. A charge is for making a payment without an order, and we create an order for you (internally). If you need to create a custom order then you need to (in this order):

1) Create an Order.

2) Use the order pay endpoint to pay for that order.

As documented here - https://docs.clover.com/docs/ecommerce-accepting-payments#paying-for-an-order


0 Likes 0 · ·
globaliwebsite avatar image globaliwebsite David Marginian ♦♦ ·

Hello,


I understand your point,


so first we create order - OK - now its unpaid


Now please guide me which END POINT i have to use to charge user card?


if i use this end point its creating one order

string chargeUrl = String.Format("https://scl-sandbox.dev.clover.com/v1/charges";);

0 Likes 0 · ·

Can you please read the documentation I provided you?

https://docs.clover.com/docs/ecommerce-accepting-payments#paying-for-an-order


0 Likes 0 · ·
Show more comments

Welcome to the
Clover Developer Community