WAAVE Checkout integration Custom install
Version 1 - last updated 11-23-2020
Javascript SDK
Overview
To use your own checkout button, invoke the WAAVE Checkout Dialog with a call to create a transaction.
Using your API key, pass on the vendor id supplying the products in the cart (venue-id), the total amount to charge, and your cart’s URL.
When the User clicks on the WAAVE Checkout button, a new browser window will guide them through WAAVE login/registration, payment method selection, and present a transaction summary for their approval.
The User accepts and pays. WAAVE site will display confirmation, send Customer a receipt over email, pass on success message to the Client site, and redirect the user back to a Client site where Client can display their own transaction success summary.
Requirements
Access Key
Venue ID
Javascript SDK
Javascript SDK URLs:
Test Payment Method:
Use the payment method below.
Please, keep transactions under $1.
Card | Card Number | Expiration | CVV |
VISA | 4111111111111111 | 10/23 | 123 |
Mastercard | 5555555555554444 | 10/23 | 123 |
HTML Sample
<div class="waavepay-checkout"
data-access-key="670ce9a7160ee0ba5411b6e9d398adb6"
data-venue-id="79021"
data-reference-id="1"
data-amount="1"
data-currency="USD"
data-return-url="http://localhost/"
data-cancel-url="https://localhost/"
data-env="test">
</div>
Parameters
Parameter | Description | Values |
data-access-key | Required. Public access key of enterprise client | String |
data-venue-id | Required. The id of venue | Integer |
data-reference-id | Your own reference id | Integer |
data-amount | Required. The order amount | Integer |
data-currency | Required. The currency of the order | String: USD, EURO, GBP, CAD. Default: USD |
data-return-url | Required. A valid url with http protocol for callback after payment with payment status | StringURL |
data-cancel-url | Required. A valid url with http protocol for callback if user cancel payment | StringURL |
data-env | String: local, test, prodDefault: prod |
Redirect to Client site:
Query string sample:
?success=1&transaction=b701cf5735e0d60e26dc42e1d8a742cb
Transaction API
Base URL
Production: https://pg.getwaave.co
Authorization Header
“
X-Api-Key
” : The Access Key“
X-Api-Signature
”: A signature used to verify the request was sent by the account holder.
How to get it:Concatenate the API Secret Key, the request URL and the json encoded of the request body (if the request body is empty, use an empty string instead)
Hash the string above with SHA-256.
Example for GET/CANCEL transaction - the request body is empty: (with PHP)
Secret Key:9e2aee3285f54e6e0f08042d694feb7a
Url:https://staging-pg.getwaave.co/waavepay/api/transaction/3dcb8ea99fc6c3651b97fcb1224c6200
hash(‘sha256’, ‘9e2aee3285f54e6e0f08042d694feb7ahttps://staging-pg.getwaave.co/waavepay/api/transaction/3dcb8ea99fc6c3651b97fcb1224c6200’) = ‘638a2a33d44b670e1c070d064b9a9c248639378cbeaf884c585f034e70e58eec’
→ “X-Api-Key” :9c719461b080911df0fe93f64feafe47
→ “X-Api-Signature”:638a2a33d44b670e1c070d064b9a9c248639378cbeaf884c585f034e70e58eec
Get Transaction info
Endpoint:
GET /api/transaction/{transactionId}
Result sample:
Success: http code 200
{
"id": "308199ae0eacc31c1c04f84a866ae522",
"venue_id": 79021,
"status": "completed",
"amount": 20.52,
"currency": "USD",
"reference_id": "3215",
"return_url": "
http://widget-demo.getwaave.co/",
"cancel_url": "
http://widget-demo.getwaave.co/",
"created_at": "2020-10-06 06:10:12"
}
Error: http code 404
{
"error": true,
"message": "Transaction not found!"
}
Cancel Transaction:
Endpoint:
PUT /api/transaction/{transactionId}/cancel
Result sample:
Success: http code 200
{
"success": true,
"id": "308199ae0eacc31c1c04f84a866ae522",
"status": "canceled"
}
Error: http code 400
{
"error": true,
"message": "Transaction has been canceled!"
}