VivaPayments / API

Index of Viva Wallet open source projects on GitHub.
139 stars 162 forks source link

Uniqueness and life cycle of OrderCode #2504

Closed orcascript closed 6 months ago

orcascript commented 6 months ago

Good morning, We need to implement recurring payments for our application. I would like you to inform me about the uniqueness and the lifecycle of OrderCode.

  1. Is OrderCode always going to be a unique-16 for every new 'subscription'? (initial payment with smart checkout and it's recurring payments)

  2. For every recurring payment of a 'subscription', is OrderCode going to be the same for all the payments?

  3. If a card payment is denied, does the 'subscription' end, meaning that I have to initialize a new order, or are there more alternatives?

We want to know if OrderCode is a reliable way to make new subscriptions and track payments within a single subscription.

VivaWalletCustomerSupport commented 6 months ago

Hello @gosusoen,

Thank you for your message. Regarding your questions, The initial payment will create a unique transaction ID and OrderCode. The transaction ID will be used to make recurring payments via the API or the Viva UI. The OrderCode remains the same throughout the process.

If the payment is denied, you can make another attempt. If the card is expired and no longer in use, you will then have to initialize a new order. Additional info about recurring payments can be found here.

Kind regards, Viva E-commerce Support Team

orcascript commented 6 months ago

Thank you for your response. If I can do another question. If the smart checkout redirects us to success url, but the payment has statusid = A(pending payment), what is the most realiable way to treat this situation? We wangt to provide a service on payment and this seems to be gray area. Thanks

VivaWalletCustomerSupport commented 6 months ago

Hello @gosusoen,

Thank you for your prompt response.

We would recommend before updating a transaction’s status on your system, to always retrieve its details from Viva. Please use the transactionId in the payload and make a call to the Retrieve Transaction API. Validate the orderCode, statusId and amount you received in the Retrieve Transaction API response and update your system accordingly

Kind regards, Viva E-commerce Support Team

orcascript commented 6 months ago

Thank you for your response. We will proceed with the information you provided us.

VivaWalletCustomerSupport commented 6 months ago

Great @gosusoen!

This ticket will close for now. Please don't hesitate to raise a new ticket if you need further assistance.

Kind regards, Viva E-commerce Support Team