For general information about accepting payments in Planyo see 
Q121: I'd like to accept credit card payments for the reservations.
 
First, select 
Viva Wallet Smart Checkout on the 
Online payments page.
 
Next, enter your 
Merchant ID, 
API key, 
Source Code, 
API Client ID and 
API Client secret. In order to get these credentials, you need to create a payment source in your Viva Wallet merchant account.
 
  Viva Wallet supports two types of account: sandbox/demo account (for testing purposes) and production/live account (for payments in the real world). You create the accounts separately. 
  When testing the integration, you need to create a sandbox/demo Viva Wallet account and enter its credentials in Planyo (merchant id, API key, source code, client ID and client secret).
  When going live, you should go to the production/live Viva Wallet account and copy to Planyo the live credentials.
Creating a payment source
Log in to your Viva Wallet backend (demo or live) and select the relevant account. Next, go to 
Sales / Online payments / Websites/Apps. Click 
Add Website/App in the top-right corner of the page.
 
In the pop-up that opens, enter the source name, e.g. 'Planyo payments'. As 
Protocol choose HTTPS. In 
Domain name enter 
www.planyo.com and in 
Integration method 
leave 
Redirection/Native Checkout v2. Next, in both 
Success URL and 
Failure URL type 
payment-vivawallet-return.php
In the 
For a perfect, one-shot approval... section below select all field and click 
Create.
 
After you add the source, copy the 
Code value (a four digit number) as this is the Source Code that you need to enter in Planyo.
 
Note that the currency in Planyo needs to match the currency of your Viva Wallet account.
 
Find API credentials
Now you need to find Merchant ID, API key, API Client ID and API Client secret in your Viva Wallet backend and paste them in Planyo.
 
Go to 
Settings / API Access. Both 
Merchant ID and 
API key are listed at the top of the 
General tab. Copy the values and enter in Planyo in the appropriate fields.
 
Next, scroll down to the 
Smart Checkout Credentials section below and click 
Generate a pair of credentials. Copy 
Client ID and 
API Client secret and enter them in Planyo. 
If you have already generated the credentials before, enter them in Planyo without generating new. If in the future you generate here new pair of API credentials, you will need to paste them in Planyo again
so we have the latest version.
 
Sample Viva Wallet credentials:
Merchant ID: ed4f5478-bc41-3r01-bdc4-980c495948r4
API key: s4e6rlf7Utf$
Source Code: 1182
API Client ID: ullowr1yrtghwuqs4zbawwqas7s5ty6zciioyynqqwm45.apps.vivapayments.com
API Client secret: 2UiSXUi459842V5Rx2uiROsJwqX44T
 
If you are using demo Viva Wallet account, select the 
Test transactions option on the 
Online payments page in Planyo. When going live, enter your live Viva Wallet account credentials and unselect 
Test transactions.
 
Webhooks
Now, you need to add webhooks pointing to a script on our server. This way we can receive updates on your transactions and automatically add payments in the corresponding reservations in Planyo.
 
Before you start adding the webhooks, make sure your Viva Wallet credentials are already added in Planyo (Merchant ID, API key, Source Code, API Client ID and API Client secret).
When adding a webhook, Viva Wallet verifies the entered url is correct. In order to to this, we need to have the credentials already available in Planyo so we can return back a correct verification code.
          
Also, note that the webhooks need to be added in demo and live Viva Wallet account separately.
    
Go to 
Settings / API Access and choose the 
Webhooks tab. You need to add one webhook for each of the three events: 
Transaction Payment Created, 
Transaction Failed and 
Transaction Reversal Created.
 
To add the first webhook, click 
Create Webhook. In the 
URL field enter https://www.planyo.com/payment-vivawallet-ipn.php?cid=-planyo-site-id-, where -planyo-site-id- is the ID of your Planyo site.
For example, if your Planyo site ID is 12345, enter https://www.planyo.com/payment-vivawallet-ipn.php?cid=12345
 
Webhook URL: https://www.planyo.com/payment-vivawallet-ipn.php?cid=12345 - replace 12345 with your Planyo site ID.
 
If you are setting up a webhook for a metasite, the ID should be prefixed with M, for example: https://www.planyo.com/payment-vivawallet-ipn.php?cid=M67890
 
Click 
Verify on the right to allow Viva Wallet verify the url. If the credentials you entered in Planyo are correct, the webhook will be accepted.
 
Next, select the 
Active option and in 
Event Type choose 
Transaction Payment Created. Click 
Save. The first webhook is added.
 
Now, repeat the same steps to add webhooks for two more event types: 
Transaction Failed and 
Transaction Reversal Created. Use the same URL 
(e.g. https://www.planyo.com/payment-vivawallet-ipn.php?cid=12345 - mind to put your Planyo site ID at the end) and also mark them as active. 
Only in each case choose 
Transaction Failed and 
Transaction Reversal Created as the event type.
 
After you are finished, you should have three active webhooks visible in the main view. Each of them should point to the same url on our website (e.g. https://www.planyo.com/payment-vivawallet-ipn.php?cid=12345) for the 
three event types.
 
Note: if you'd like  to test Viva Wallet in the 
sandbox version of your Planyo account first, use the webhook url pointing to sandbox.planyo.com, e.g.: https://sandbox.planyo.com/payment-vivawallet-ipn.php?cid=12345