ClickGem PayGate API Intergration Guide

 

Introduction: https://www.clickgem.com/paygate.html
Presentation: https://www.clickgem.com/presentation.html
Detail solution: https://www.clickgem.com/uploads/attachments/General-Idea-and-Strategy.pdf

 

Getting Started:

After completed merchant verification progress (KYC) for using ClickGem PayGate module, you will get API User, API Password, and API Signature

- API User: The API user is a separate user created for your merchant account in ClickGem PayGate system. Its only purpose is to allow an application (your shopping cart or other payment collecting applications) to create and/or maintain transactions on our platform. Unlike other users, you can't login with the API user.

- API Password: Password for your API User

- API Signature: Along with API User and API Password, API signature is a credential to pair our platform with your application.

Create invoice

This module used to create invoice

Action: https://api.clickgem.com/paygate/create/

Parameters Type Required Description
invoiceNumber String Yes Invoice Number
invoiceDate Time Yes Invoice Date
billTo String Yes Buyer's email address
paymentType String Yes Type of payment: one, multiple (one time, multiple times: the buyer no need to pay full amount of the invoice in one time)
feeTo String Yes Transaction fee charge to: Seller, Buyer, Seller and Buyer (Seller and Buyer: each person shares 50% of the fee)
itemUnit String Yes Unit of the item: Quantity, Hours, Amount only
dueDate String Yes Due date: 0, 12h, 1d, 3d, 1w, 1m (0: the invoice will never expired)
currency String Yes Main currency of the invoice: USD, EUR, BTC, CGM, BCH, LTC, etc... (Merchant will receive payment by this currency even when buyers pay with another currency)
itemDiscount String Yes Discount on each item: by percent or a specified amount of money
otherDiscount Float Optional Discount on total amount: by percent or a specified amount of money
shippingCost Float Optional Cost of delivery
notes String Optional Other notes to the buyer
terms String Optional Terms & Conditions of the invoice
websiteURL String Yes URL to receive result of the payment which processed by our system (Your "Thank you" page)
item json Yes

List information of the item: [ itemName, itemQuantity, itemPrice, discountAmount, discountType, itemDescription ]

- itemName: Name of the item { String, Required }
- itemQuantity: Number of the item { Float, Required }
- itemPrice: Unit price of the item { Float, Required }
- discountAmount: Amount of money/percent which discounted for the item { Float, Required }
- discountType: Type of discount: %, money { Float, Required }
- itemDescription: Other description of the item { String, Optional }

billingAddress json Yes

List information of billing address: [ bl_firstname, bl_lastname, bl_address, bl_city, bl_postcode, bl_country, bl_telephone, bl_notes ]

- bl_firstname: First name { String, Required }
- bl_lastname: Last name { String, Required }
- bl_address: Billing address { String, Required }
- bl_city: City { String, Required }
- bl_postcode: Postcode { String, Required }
- bl_country: Country { String, Required }
- bl_telephone: Telephone { String, Required }
- bl_note: Address notes { String, Optional }

shippingAddress json Yes

List information of shipping address: [ sp_firstname, sp_lastname, sp_address, sp_city, sp_postcode, sp_country, sp_telephone, sp_notes ]

- sp_firstname: First name { String, Required }
- sp_lastname: Last name { String, Required }
- sp_address: Billing address { String, Required }
- sp_city: City { String, Required }
- sp_postcode: Postcode { String, Required }
- sp_country: Country { String, Required }
- sp_telephone: Telephone { String, Required }
- sp_note: Address notes { String, Optional }

Returns: JSONObject
{ "code":200 "success":"https://www.clickgem.com/paygate/pay.html?getid=25271cc72dca94b28ead9829fb317e06" }
Show invoice

This module to query invoices by their information

Action: https://api.clickgem.com/paygate/show/

Parameters Type Required Description
invoiceNumber String Optional Query invoices with Invoice Number
fromDate Int Optional Query invoices with dates start from ["fromDate"]
untilDate Int Optional Query invoices with dates until ["untilDate"]
currency String Optional Query invoices with currency: USD, CGM, EUR, BTC, LTC, etc...
billToMail String Optional Query invoices with buyer's email address
dueDate String Optional Query invoices with due date: 0, 12h, 1d, 3d, 1w, 1m
status String Optional Query invoices with payment status: Paid, Unpaid, Partially Paid
fromAmount Float Optional Query invoices with total amount start from ["fromAmount"]
untilAmount Float Optional Query invoices with total amount until ["untilAmount"]
Returns: JSONObject
{ "code":200 "success":"[{
						"invoiceNumber" : "123124",
						"invoiceDate" : "02:58:36 04\/11\/2018",
						"currency" : "USD",
						"reference" : " ",
						"dueDate" : 0,
						"billTo" : "[email protected]",
						"ccMail" : " ",
						"discount" : 0,
						"discountType" : "USD",
						"itemUnit" : "quantity",
						"paymentType" : "one",
						"feeTo" : "customers_creator",
						"shippingCost" : 0,
						"status" : "paid",
						"total" : 6,
						"totalFee" : 6.375,
						"totalReceived" : 5.625,
						"returnw" : " ",
						"notes" : " ",
						"terms" : " "
						}]" }
Get Status

This module to query status of invoice

Action: https://api.clickgem.com/paygate/getstatus/

Parameters Type Required Description
getid String Yes Query invoice by ID of the order
Returns: JSONObject
{ "code":200 "success":"notification" }
Amount Paid

This module to query amount paid of invoices

Action: https://api.clickgem.com/paygate/amountpaid/

Parameters Type Required Description
getid String Yes Query invoice by ID of the order
Returns: JSONObject
{ "code":200 "success":"[{
						"status" : "paid",
						"amountPaid" : "500",
						"unit" : "CGM" >> "currency" : "CGM"
						}]" }
Download e-Commerce Plugins

These plugins support e-Commerce platforms to process and receive payments via ClickGem PayGate

WooCommerce: https://github.com/clickgem/ClickGem-WooCommerce-Plugin
OpenCart: https://github.com/clickgem/ClickGem-OpenCart-Plugin