Hello,
Following documentation to generate token, create order and pay for order, on the last steps its giving error can you please guide me what i am doing wrong
1. I generate card token using this end point
https://docs.clover.com/docs/ecommerce-accepting-payments#paying-for-an-order
This is the return
Card token Generate ============================ { "id":"clv_1TSTS1triFHZoXCqZAYbmUjx" "object":"token" "card":{ "exp_month":"12" "exp_year":"2021" "first6":"424242" "last4":"4242" "brand":"VISA" } }
2. I post order- using this end point
https://docs.clover.com/reference/orders#postorders
This is the return
POST order ================ { "id":"NYR6DBS1WQMAG" "object":"order" "amount":1800 "currency":"usd" "created":1603989316000 "customer":"NPF9JX196QAE2" "email":"globaliwebsite@gmail.com" "items":[ 0:{...} 1:{...} ] "shipping":{ "name":"nausheen imtiaz" "phone":"0000000" "address":{...} } "status":"created" }
2. Pay for and order I used this end point but its failing not sure why
https://docs.clover.com/reference/orders#postordersidpay
This is the what i am sending
var client = new RestClient("https://scl-sandbox.dev.clover.com/v1/orders/NYR6DBS1WQMAG/pay"); var request = new RestRequest(Method.POST); request.AddHeader("Accept", "application/json"); request.AddHeader("Content-Type", "application/json"); request.AddHeader("Authorization", "Bearer 2581a7d1-80db-acb7-871c-14a84ab1472d"); request.AddParameter("application/json", "{\"ecomind\":\"ecom\",\"external_reference_id\":\"00125\",\"source\":\"clv_1TSTS1triFHZoXCqZAYbmUjx\"}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
Order ID: which i generated in step 2
Source: is the id i generated in step 1
but it gives following error please advice me
Your OAuth2 token is incorrect or has expired
Please advice me on step 3 what is wrong, the bearer key I passed is working fine when i generated the tokenized on step 1 not sure why not working to pay