question

kcinfuse avatar image
kcinfuse asked kcinfuse published

Offline Cash Payment Refund

Using the payment connector's refundPayment method, I am able to refund a cash payment while the device is online. However, when I am offline, I get the error:

RefundPaymentResponse{json='{"message":"Refund failed","success":false,"result":"FAIL","refund":null}', bundle=null, changeLog=Bundle[{success=null, refund=null, result=null, message=null}]}
Tracing the error, it seems like it occurs when the PaymentRefundCardNotPresentActivity tries to make a POST request to the clover api: https://apisandbox.dev.clover.com/v2/refund
I/SetupAsyncTask( 2066): doInBackground(SetupAsyncTask.java:59): PaymentRefundCardNotPresentActivity @41ecfd18 success: true isCancelled: false
I/SetupAsyncTask( 2066): onPostExecute(SetupAsyncTask.java:67): result:true, commonActivity: true
I/SetupAsyncTask( 2066): onPostExecute(SetupAsyncTask.java:73): PaymentRefundCardNotPresentActivity @41ecfd18 isFinishing: false, resumed: true
I/SetupAsyncTask( 2066): onPostExecute(SetupAsyncTask.java:115): PaymentRefundCardNotPresentActivity @41ecfd18 setup tasks took: 56ms
I/CloverOkHttpClient( 1830): execute(CloverOkHttpClient.java:211): Starting POST to url: https://apisandbox.dev.clover.com/v2/refund
D/dalvikvm( 2066): GC_CONCURRENT freed 1132K, 21% free 6664K/8380K, paused 4ms+5ms, total 62ms
D/AcceptLanguage( 1830): value=en-US
I/CloverOkHttpClient( 1830): execute(CloverOkHttpClient.java:250): Exception occurred while processing request url: https://apisandbox.dev.clover.com/v2/refund
W/System.err( 1830): com.clover.common.http.NetworkErrorException
W/System.err( 1830): 	at com.clover.engine.io.http.CloverOkHttpClient.newNetworkErrorException(CloverOkHttpClient.java:135)
W/System.err( 1830): 	at com.clover.engine.io.http.CloverOkHttpClient.execute(CloverOkHttpClient.java:252)
W/System.err( 1830): 	at com.clover.engine.io.http.CloverOkHttpClient.execute(CloverOkHttpClient.java:201)
W/System.err( 1830): 	at com.clover.engine.io.http.CloverOkHttpClient.execute(CloverOkHttpClient.java:196)
W/System.err( 1830): 	at com.clover.engine.io.http.CloverOkHttpClient.post(CloverOkHttpClient.java:362)
W/System.err( 1830): 	at com.clover.engine.order.v3.OrderEndpoints.post(OrderEndpoints.java:103)
W/System.err( 1830): 	at com.clover.engine.order.v3.OrderEndpoints.addRefundBlocking(OrderEndpoints.java:290)
W/System.err( 1830): 	at com.clover.engine.order.v3.OrderBinderImpl.refund2(OrderBinderImpl.java:2426)
W/System.err( 1830): 	at com.clover.engine.order.v3.OrderBinderV3_1.refund2(OrderBinderV3_1.java:362)
W/System.err( 1830): 	at com.clover.sdk.v3.order.IOrderServiceV3_1$Stub.onTransact(IOrderServiceV3_1.java:2145)
W/System.err( 1830): 	at android.os.Binder.execTransact(Binder.java:404)
W/System.err( 1830): 	at dalvik.system.NativeStart.run(Native Method)
E/PaymentRefundCardNotPresentActivity( 2066): doInBackground(PaymentRefundCardNotPresentActivity.java:162): refund failed
E/PaymentRefundCardNotPresentActivity( 2066): com.clover.sdk.v1.ClientException: status code: 999




Is there a way to make the refundPayment offline for cash payments? It seems like I am able to do so in the native Transactions app while offline.
Clover Android SDKPaymentConnector
10 |2000

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

0 Answers

·

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