Redirected Integration

How It Works

Endpoint

https://api.grubpay.io/v4/auth

Method:

POST

Content-Type: application/json;charset=UTF-8

Card Purchase Guide

What is capture

Capture authorizes the transaction through to settlement and may be triggered during purchase request (see capture field in the request) or some time after the initial authorization is submitted via Capture api.

! Tip

After you receive access credentials (merchant id, login name, merchant key). You can step through the demo Card Purchaseopen in new window which may help you when going through the documentation.

1. Request to Endpoint with format below
Request
NameRequiredTypeSampleDescription
mchIdyString10000701assigned by GrubPay
mchOrderNoyString1234567890abcassigned by merchant
amountyInt1500in cents; must > 0
currencyyString(3)USDfixed to: USD
loginNameyString(12)jack123merchant's login name
subjectnString(64)
bodynString(250)
channelyStringCC_CARDfixed to: CC_CARD
capturenStringY or N (default Y)specify Y to capture the transaction for settlement if approved
returnUrlyString(200)http://sample.com/returnmerchant url to redirect after order submit, must be http or https
signyString(32)C380BEC2BFD727A4B6845133519F3AD6Sign algorithm
2. Redirect to `redirectUrl` in response below to GrubPay payment page

Sample redirect url: https://api.grubpay.io/auth?secureId=8ca3658204023b27eb998197165142eb6193868cfa730edc81b0877640c58f8c

Response
nameRequiredtypesampledescription
retCodeyStringSUCCESS or FAIL
retMsgyString
retData.redirectUrly*String*if retCode is SUCCESS and valid `returnUrl` is present in request
3. After customer submit GrubPay form, payment page will automatically redirect to merchant supplied `returnUrl` with following parameters

Sample return url: https://example.com/return?payOrderId=xxx&status=2&retCode=xxxxxxx&retMsg=xxxxxxxx

nameRequiredtypesampledescription
payOrderIdyStringPC20221125212844814733300243
mchOrderNoyString1669411724
statusyInt0,1,2,90 = pending order, 1 = unknown, 2 = success, 9 = fail
retMsgyString
retCodey*String*if retCode is SUCCESS and valid `returnUrl` is present in request
retMsgyString

For details see Query Transaction

Card Tokenize Guide

Info

GrubPay provides encryption and tokenization services with a secure data vault typically used to store payment card Primary Account Numbers in a PCI-DSS compliant manner. GrubPay generates a unique and random token value to be used by your application instead of a clear or encrypted PAN, potentially reducing your PCI scope considerably.

! Tip

After you receive access credentials (merchant id, login name, merchant key). You can step through the demo Card Tokenizeopen in new window which may help you when going through the documentation.

1. Request to Endpoint with format below
Request
NameRequiredTypeSampleDescription
mchIdyString0000701assigned by GrubPay
loginNameyString(12)jack123merchant's login name
channelyStringCC_CARDfixed to: CC_CARD
returnUrlyString(200)merchant url to redirect after order submit
signyString(32)C380BEC2BFD727A4B6845133519F3AD6Sign algorithm
2. Redirect to `redirectUrl` in response to see GrubPay card form

Sample redirect url: https://api.grubpay.io/auth?secureId=8ca3658204023b27eb998197165142eb6193868cfa730edc81b0877640c58f8c

3. After customer submit GrubPay form, payment page will automatically redirect to merchant supplied `returnUrl` with following parameters

Sample return url: https://example.com/return?token=xxx&retCode=xxxxxxx&retMsg=xxxxxxxx

nameRequiredtypesampledescription
token*yString(36)5caeca18-4a54-49d1-af48-85e42af9a8ab*if retCode is SUCCESS and valid `returnUrl` is present in request
retMsgyString
retCodeyString
4. You can now use this token for future purchases

ACH Transfer Guide

Tip

ACH transactions are automatically captured upon authorization. There is no tokenization api, tokens for direct method are created upon successful ACH transfer.

1. Request to Endpoint with format below
Request
NameRequiredTypeSampleDescription
mchIdyString10000701assigned by GrubPay
mchOrderNoyString1234567890abcassigned by merchant
amountyInt1500in cents; must > 0
currencyyString(3)USDfixed to: USD
loginNameyString(12)jack123merchant's login name
subjectnString(64)
bodynString(250)
channelyStringCC_ACHfixed to: CC_ACH
returnUrlyString(200)http://sample.com/returnmerchant url to redirect after order submit, must be http or https
notifyUrlyString(200)http://sample.com/notifymerchant endpoint for receiving ACH transaction notifications , must be http or https
signyString(32)C380BEC2BFD727A4B6845133519F3AD6Sign algorithm
2. Redirect to `redirectUrl` in response below to GrubPay payment page

Sample redirect url: https://api.grubpay.io/auth?secureId=8ca3658204023b27eb998197165142eb6193868cfa730edc81b0877640c58f8c

Response
nameRequiredtypesampledescription
retCodeyStringSUCCESS or FAIL
retMsgyString
retData.redirectUrly*String*if retCode is SUCCESS and valid `returnUrl` is present in request
3. After customer submit GrubPay form, payment page will automatically redirect to merchant supplied `returnUrl` with following parameters

Sample return url: https://example.com/return?payOrderId=xxx&status=2&retCode=xxxxxxx&retMsg=xxxxxxxx

nameRequiredtypesampledescription
payOrderIdyStringPC20221125212844814733300243
mchOrderNoyString1669411724
statusyInt0,1,2,90 = pending order, 1 = unknown, 2 = success, 9 = fail
retMsgyString
retCodey*String*if retCode is SUCCESS and valid `returnUrl` is present in request
retMsgyString

For details see Query Transaction

Last Updated:
Contributors: grant, Grant, Grant Yao, Edward