question

rjacobsen0 avatar image
rjacobsen0 asked rjacobsen0 answered

Give the user a meaningful receipt screen after hosted checkout

I am using hosted checkout and working in the sandbox, for now. I set up the success url, and webhook url on the hosted checkout setup page. They are both working. The webhook receives a number of useful fields, including the payment id, merchant id, and session id. But it has no way to display data to the user. It must return a simple 200 OK. The success url gets no data at all, but allows me to display a page to the user. So my question is this: How can I display an interesting and useful receipt to the user? I would like to display the amount paid, card type, last 4 digits, a button to request that this card be saved as a card on file for future use, and a link back to the store. I am capable of using a messaging mechanism to get the data to the user, but this seems overly complex. Is there a simple way to give the user a meaningful receipt?

ecommerce
1 comment
10 |2000

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

rjacobsen0 avatar image rjacobsen0 commented ·

The part where I said "I am capable of using a messaging mechanism to get the data to the user" I would like to take that back. Without any data indicating which receipt to display, I'm likely to get streams crossed and display someone else's receipt to the user. What am I missing? Some configuration?

0 Likes 0 ·

1 Answer

·
rjacobsen0 avatar image
rjacobsen0 answered

When you call /invoicingcheckoutservice/v1/checkouts to get the sessionId, set a cookie in the user's browser containing the sessionId.

When you get the success callback, use the sessionId saved in the cookie to look up info about the payment and show the receipt. Clover does not provide the sessionId in the payload (as if it were a POST) or query string (for a GET call) or in the URL itself. It is not a dynamic URL.

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