Credit / Debit Cards
GetzPay enables you to seamlessly charge local and international credit / debit cards that are on Visa and Mastercard. We build our integrations to optimize card acceptance rates for all the cards that we help you to accept.
Why Use GetzPay for Cards
On top of having leading acceptance rates for domestic and international credit / debit cards, as well as robust fraud detection systems, our suite of Cards features includes support for:
- Types: One-time payments
- Authentication: Dynamic 3D Secure
Our card processing system is protected by fraud decetion and prevention systems. All cards transactions are reflected in the GetzPay Dashboard.
Card Payment Flow
Getting Started
The three main methods of accepting card payments with GetzPay are:
Payment Link
Auto generated payment page
Login with your merchant account, in 'Other Payment Methods' section, select 'Payment Link' and fill in the mandatory textfield.
Sample Screenshot
To learn more about the parameters, please check the 'Button parameters' table of 1.Embed the Payment Button.
Reference Id
This ID can be served as the merchant reference ID. This ID should be unique in the merchant system.
Total Amount
The total amount to be charged to the customer credit card. It should be the sum of the subtotal for each item, delivery charge, discounted amount and tax amount.
Success Page URL
URL to go when users have completed the payment in GetzPay page.
Cancel Page URL
URL to go when users click 'Cancel' in GetzPay page.
Items List
- Item : Title/name for item x (x can range from 1 to 20). Eg. $4.99 Voucher deal.
- Description : Description for the item x.
- Items Quantity : The quantity for item x.
- Items Amount : The unit price for item x.
Redirect Link
Please see the Redirect Link section for more information.
1. Embed the Payment Button
To get started, add the following 'sample code' to your checkout page. For details of each parameter, look at the 'button parameters' table after the sample code.
Sample Code
'<form action="{getzpay-url}" method="post" >'
'<input type="hidden" name="version" value="3.0" />'
'<input type="hidden" name="action" value="pay" />'
'<input type="hidden" name="merchant" value="your@email.com" />'
'<input type="hidden" name="customer_idd" value="65">'
'<input type="hidden" name="customer_contact" value="123456789">'
'<input type="hidden" name="customer_email" value="customer@email.com">'
'<input type="hidden" name="ref_id" value="" />'
'<input type="hidden" name="item_name_1" value="item 1" />'
'<input type="hidden" name="item_sku_1" value="SKU1">'
'<input type="hidden" name="item_description_1" value="Description for item 1" />'
'<input type="hidden" name="item_quantity_1" value="1" />'
'<input type="hidden" name="item_amount_1" value="1.00" />'
'<input type="hidden" name="item_packingfee_1" value="0">'
'<input type="hidden" name="is_taxable_1" value="1">'
'<input type="hidden" name="is_discountable_1" value="1">'
'<input type="hidden" name="is_pointsable_1" value="1">'
'<input type="hidden" name="item_name_2" value="item 2" />'
'<input type="hidden" name="item_description_2" value="Description for item 2" />'
'<input type="hidden" name="item_quantity_2" value="1" />'
'<input type="hidden" name="item_amount_2" value="1.00" />'
'<input type="hidden" name="item_packingfee_2" value="0">'
'<input type="hidden" name="is_taxable_2" value="1">'
'<input type="hidden" name="is_discountable_2" value="1">'
'<input type="hidden" name="is_pointsable_2" value="1">'
'<!--(Optional) <input type="hidden" name="delivery_charge" value="0.00" />-->'
'<!--(Optional) <input type="hidden" name="tax_amount" value="0.00" />-->'
'<!--(Optional) <input type="hidden" name="tax_percentage " value="8.00" />-->'
'<!--(Optional) <input type="hidden" name="fulfilled_date_time" value="2022-03-07 10:30"> -->'
'<!--(Optional) <input type="hidden" name="fulfilled_date_time_to" value="2022-03-07 10:45"> -->'
'<input type="hidden" name="currency" value="SGD" />'
'<input type="hidden" name="order_tag" value="STATIONORDERING">'
'<input type="hidden" name="delivery_charge" value="0">'
'<input type="hidden" name="discount_1_total" value="1">'
'<input type="hidden" name="discount_1_value" value="0">'
'<input type="hidden" name="discount_1_type" value="1">'
'<input type="hidden" name="total_amount" value="2.00" />'
'<input type="hidden" name="success_url" value="http://www.yourweb.com/SuccessPage" />'
'<input type="hidden" name="skip_success_page" value="1">'
'<input type="hidden" name="cancel_url" value="http://www.yourweb.com" />'
'<!--(Optional) <input type="hidden" name="str_url" value="http://www.yourweb.com/StrHandler" />-->'
'<input type="hidden" name="signature" value="">'
'<input type="hidden" name="signature_algorithm" value="sha1">'
'<input type="image" src="https://www.getzpay.com/img/btn_getzpay_v1.png" name="submit" alt="GetzPay!" />'
'</form>'
Button Parameters
Name | Description |
---|---|
version | Fixed. Please use '3.0'. |
action | The action of the current payment. Currently, GetzPay supports only 'pay' |
merchant | Email address/user ID of the merchant account registered with GetzPay. |
ref_id | This ID can be served as the merchant reference ID. This ID should be unique in the merchant system. |
item_name_x | Title/name for item x (x can range from 1 to 20). Eg. $4.99 Voucher deal |
item_description_x | Description for the item x. |
item_quantity_x | The quantity for item x |
item_amount_x | The unit price for item x. |
delivery_charge (optional) | The amount for delivery charge. (For display only, total amount will not be affected) Default: 0.00 if not specified |
discount_amount (optional) | New!The discounted amount. (Eg. -2.50 for discount of $2.50) (For display only, total amount will not be affected) Default: 0.00 if not specified |
tax_amount (optional) | The amount for tax. (For display only, total amount will not be affected) Default: 0.00 if not specified If specified, the parameter 'tax_percentage' must be specified. |
tax_percentage (optional) | The percentage of the tax. Eg. '8' (for 8%) (For display only, total amount will not be affected) Default: 0 if not specified If specified, the parameter 'tax_amount' must be specified. |
fulfilled_date_time (optional) | New!This value will be used to determine the voucher redemption eligibility. (Eg. 2016-05-05 22:22) Default: Current Date Time if not specified |
currency | Currently, GetzPay supports only 'SGD' and 'USD'. Default: 'SGD' |
total_amount | The total amount to be charged to the customer credit card. It should be the sum of the subtotal for each item, delivery charge, discounted amount and tax amount. |
success_url | URL to go when users have completed the payment in GetzPay page. |
skip_success_page (optional) | Use '1' - Yes. '0' - No (default) If 'skip_success_page' flag is set to '1', customer will not see the GetzPay success page after payment is made successfully. The customer will instead be redirected back to the provided 'success_url'. Transaction response and payment details will be added to the 'success_url' and the details are: - 'merchant' - 'ref_id' - 'reference_code' - 'response_code' - 'currency' - 'total_amount' - 'signature' - 'signature_algorithm' The description for each field is exactly the same as the STR fields. Please refer to the 'STR Parameters' section for more information. Eg. 'success_url' = http://www.website.com/success When the payment is made successfully, the customer will be redirected to the Url: http://www.website.com/success?merchant=your@email.com; ref_id=yourReference;reference_code=GetzPayReference; response_code=1;currency=SGD;total_amount=2.00; signature=52Hoducpo254hoUfhac;signature_algorithm=sha1 |
cancel_url | URL to go when users click 'Cancel' in GetzPay page. |
str_url (optional) | GetzPay Transaction Response Url. When a payment is successfully paid, GetzPay Server will post a STR to this URL with the transaction details before the customer is redirected to the 'GetzPay Success Page'. |
customer_idd (optional) | New!Customer country calling code (IDD) to be pre-populated into the Contact number field inside GetzPay checkout page. (Ignore the '+' sign) |
customer_contact (optional) | New!Customer mobile number to be pre-populated into the Contact number field inside GetzPay checkout page. (Exclude country calling codes) If specified, the parameter 'customer_idd' must be specified. |
customer_email (optional) | New!Customer email address to be pre-populated into the Email field inside GetzPay checkout page. |
signature | An unique signature generated using the 'Secret Key' found in your merchant setting page. Concatenating the following fields: - Note! Secret Key (Found in your merchant setting page) - the form post 'merchant' value - the form post 'action' value (Eg. 'pay') - the form post 'ref_id' value - the form post 'total_amount' value (Eg. '2.00') - the form post 'currency' value (Eg. 'SGD') For more information on the signature generation, please refer to the 'Signature Generation' section. |
signature_algorithm | Fixed. Please use 'sha1'. |
item_sku_x | The SKU for item x. |
item_packingfee_x | The packingfee for item x. |
is_taxable_x | Use - '0' = Not Taxable - '1'= Taxable if 'item_taxable_x' flag is set to 1, the item will be taxed. |
is_discountable_x | Use - '0' = Not Discountable - '1'= Discountable if 'item_discountable_x' flag is set to 1, Items can be discounted if the transaction uses a voucher. |
is_pointsable_x | Use - '0' = Not Pointsable - '1'= Pointsable if 'item_pointsable_x' flag is set to 1, Items can be discounted if the transaction uses a voucher. |
fulfilled_date_time_to | New!This value will be used to determine the voucher redemption eligibility. (Eg. 2016-05-05 22:22) Default: Current Date Time if not specified |
order_tag | - DELIVERY - DINEIN - TAKEAWAY |
discount_x_total | The discounted amount.(Eg. if discount_x_type '1', discount_x_value '10', total_amount '100'. discount_x_total is '10'. |
discount_x_value | The discounted value |
discount_x_type | use - '0' = $ - '1' = % if 'discount_x_type' flag is set to 0, discount type is $ |
2. Signature Generation
The signature is used to protect the data exchanged between your server with GetzPay server. The signature should be generated using the following two steps:
Step 1
Concatenate the relevant parameters into a single string (Eg. signature for form post)
- Secret Key (Found in your merchant setting page)
- The form post 'merchant' value
- The form post 'action' value (Eg. 'pay')
- The form post 'ref_id' value
- The form post 'total_amount' value (Eg. '2.00')
- The form post 'currency' value (Eg. 'SGD')
Step 2
Hash the concatenated string using SHA1 algorithm.
Sample codes: PHP
"$dataToBeHashed = $secret_key"
". $merchant"
". $action"
". $ref_id"
". $total_amount"
". $currency;"
"$utfString = mb_convert_encoding($dataToBeHashed, "UTF-8");"
"$signature = sha1($utfString, false);"
Sample codes: ASP .Net (C#)
"string dataToBeHashed = SecretKey"
"+ MerchantEmail"
"+ Action"
"+ ReferenceId"
"+ TotalAmount"
"+ Currency;"
"var sha1 = new SHA1CryptoServiceProvider();"
"var passwordBytes = Encoding.UTF8.GetBytes(dataToBeHashed);"
"var passwordHash = sha1.ComputeHash(passwordBytes);"
"var signature = BitConverter.ToString(passwordHash).Replace("-", string.Empty).ToLowerInvariant();"
Sample codes: Java
We recommend you to use Apache Commons Codec (version 1.7+) for the hash function.
"String dataToBeHashed = SecretKey"
"+ MerchantEmail"
"+ Action"
"+ ReferenceId"
"+ TotalAmount"
"+ Currency;"
"String signature = DigestUtils.sha1Hex(dataToBeHashed);"
3. Redirect Method (Signature is not required)
In this method, server to server call is used. Hence the signature is not required in the POST form. Usage / Flow:
Use
- PHP : Curl
- C# : HttpWebRequest/HttpWebResponse or WebClient or HttpClient to make a server to server POST to GetzPay server.
GetzPay will return a JSON response.
Decode the JSON response to retrieve the 'redirect_url'.
Redirect the customer to the 'redirect_url' to continue with the payment.
Sample Code
'<form action="{getzpay-url}" method="post" >'
'<input type="hidden" name="version" value="3.0" />'
'<input type="hidden" name="action" value="pay" />'
'<input type="hidden" name="merchant" value="your@email.com" />'
'<input type="hidden" name="customer_idd" value="65">'
'<input type="hidden" name="customer_contact" value="123456789">'
'<input type="hidden" name="customer_email" value="customer@email.com">'
'<input type="hidden" name="ref_id" value="" />'
'<input type="hidden" name="item_name_1" value="item 1" />'
'<input type="hidden" name="item_sku_1" value="SKU1">'
'<input type="hidden" name="item_description_1" value="Description for item 1" />'
'<input type="hidden" name="item_quantity_1" value="1" />'
'<input type="hidden" name="item_amount_1" value="1.00" />'
'<input type="hidden" name="item_packingfee_1" value="0">'
'<input type="hidden" name="is_taxable_1" value="1">'
'<input type="hidden" name="is_discountable_1" value="1">'
'<input type="hidden" name="is_pointsable_1" value="1">'
'<input type="hidden" name="item_name_2" value="item 2" />'
'<input type="hidden" name="item_description_2" value="Description for item 2" />'
'<input type="hidden" name="item_quantity_2" value="1" />'
'<input type="hidden" name="item_amount_2" value="1.00" />'
'<input type="hidden" name="item_packingfee_2" value="0">'
'<input type="hidden" name="is_taxable_2" value="1">'
'<input type="hidden" name="is_discountable_2" value="1">'
'<input type="hidden" name="is_pointsable_2" value="1">'
'<!--(Optional) <input type="hidden" name="delivery_charge" value="0.00" />-->'
'<!--(Optional) <input type="hidden" name="tax_amount" value="0.00" />-->'
'<!--(Optional) <input type="hidden" name="tax_percentage " value="8.00" />-->'
'<!--(Optional) <input type="hidden" name="fulfilled_date_time" value="2022-03-07 10:30"> -->'
'<!--(Optional) <input type="hidden" name="fulfilled_date_time_to" value="2022-03-07 10:45"> -->'
'<input type="hidden" name="currency" value="SGD" />'
'<input type="hidden" name="order_tag" value="STATIONORDERING">'
'<input type="hidden" name="delivery_charge" value="0">'
'<input type="hidden" name="discount_1_total" value="1">'
'<input type="hidden" name="discount_1_value" value="0">'
'<input type="hidden" name="discount_1_type" value="1">'
'<input type="hidden" name="total_amount" value="2.00" />'
'<input type="hidden" name="success_url" value="http://www.yourweb.com/SuccessPage" />'
'<input type="hidden" name="skip_success_page" value="1">'
'<input type="hidden" name="cancel_url" value="http://www.yourweb.com" />'
'<!--(Optional) <input type="hidden" name="str_url" value="http://www.yourweb.com/StrHandler" />-->'
'<input type="image" src="https://www.getzpay.com/img/btn_getzpay_v1.png" name="submit" alt="GetzPay!" />'
'</form>'
Please refer to Button Parameters for more parameter information and usage. Note! The "signature" and "signature_method" parameters are not required in this method.
Sample Response (JSON)
"status":1,"redirect_url":"{getzpay-url}","message":"Success"
Name | Type | Description |
---|---|---|
status | int | 1 - Success -1 - Failed |
redirect_url | string | The url to be used to redirect the customer to immediately. |
message | string | Contains success message or fail message |
Cards APIs
Please continue to the onboarding & activation section.