For using this SDK, you might copy all files in src folder and paste it to your project. Then you should import 2 classes MerchantIntegrationOnline
, MerchantIntegrationOffline
in src
folder.
stage
: String : either "PRD" or "STG"country
: String : ISO 3166-1 Alpha-2 country code of the merchant location.partner_id
: String - Unique ID for a partner. Retrieve from Developer Homepartner_secret
: String - Secret key for a partner. Retrieve from Developer Homemerchant_id
: String - Retrieve from Developer Hometerminal_id
: String - Retrieve from Developer Home (POS only)client_id
: String - Retrieve from Developer Home (OTC only)client_secret
: String - Retrieve from Developer Home (OTC only)redirect_url
: String - The url configured in Developer Home (OTC only)
from MerchantIntegrationOnline import MerchantIntegrationOnline
callOna = MerchantIntegrationOnline(stage, country, partner_id, partner_secret, merchant_id, client_id, client_secret, redirect_url)
- Charge Init:
respChargeInit = callOna.onaChargeInit(
partnerTxID,
partnerGroupTxID,
amount,
currency,
description,
metaInfo={},
items={},
shippingDetails={},
hidePaymentMethods=[]
)
- Create Web Url:
respChargeInit = callOna.onaCreateWebUrl(
partnerTxID,
partnerGroupTxID,
amount,
currency,
description,
codeVerifier,
metaInfo={},
items={},
shippingDetails={},
hidePaymentMethods=[],
state=None
)
- get OAuth Token
respAuthCode = callOna.onaOAuthToken(code, codeVerifier)
- Charge Complete
respChargeComplete = callOna.onaChargeComplete(partnerTxID, respAuthCode.access_token)
5 Get Charge status
respChargeStatus = callOna.onaGetChargeStatus(partnerTxID, currency, respAuthCode.accessToken)
- refund online
response = callOna.onaRefund(refundPartnerTxID, amount, origPartnerTxID, description, respAuthCode.accessToken, currency)
- Get Refund Status
response = callOna.onaGetRefundStatus(partnerTxID, respAuthCode.accessToken, currency)
- Get One time charge status
response = callOna.onaGetOtcStatus(partnerTxID, respAuthCode.accessToken, currency)
from MerchantIntegrationOffline import MerchantIntegrationOffline
callPos = MerchantIntegrationOffline(stage, country, partner_id, partner_secret, merchant_id, terminal_id)
- Create QR Code
respCreateQRCode = callPos.posCreateQRCode(msgID, partnerTxID, amount, currency)
- Get transaction status:
resp = callPos.posGetTxnStatus(msgID, partnerTxID, currency)
- cancelTxn
resp = callPos.posCancel(msgID, partnerTxID, origPartnerTxID, origTxID, currency)
- refund Pos transaction
resp = callPos.posRefund(msgID, partnerTxID, originTxID, amount, description, currency)
- Get refund transaction status:
resp = callPos.posGetRefundStatus(msgID, partnerTxID, currency)
- performTxn
resp = callPos.posPerformQRCode(msgID, partnerTxID, amount, code, currency)
© 2022 GrabTaxi Holdings Pte Ltd. All rights reserved. Any use of such assets are governed by the API Terms and Conditions (available at Grab Developer).