The .NET SDK is provided as a .NET library targeted at .NET Standard 2.0.
- Add Net library to your solution.
Right click on your project solution. Select
Add
->Existing project
-> SelectNet.csproj
file. - Import Net project to your project.
Right click on your project Dependencies. Select
Add Reference
-> SelectNet
Project.
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)
using Net.Public;
// ...
MerchantIntegrationOnline clientOnA = new MerchantIntegrationOnline(stage, country, partner_id, partner_secret, merchant_id, client_id, client_secret, redirect_url);
- Charge Init:
respChargeInit = clientOnA.OnaChargeInit(partnerTxID, partnerGroupTxID, amount, currency, description, metaInfo, items, shippingDetails, hidePaymentMethods)
- Create Web Url:
respCreateWebUrl = clientOnA.OnaCreateWebUrl(partnerTxID, partnerGroupTxID, amount, currency, codeVerifier, description, metaInfo, items, shippingDetails, hidePaymentMethods, state)
- get OAuth Token
respAuthCode = clientOnA.OnaOAuth2Token(code, codeVerifier)
- Charge Complete
respChargeComplete = clientOnA.OnaChargeComplete(partnerTxID,respAuthCode.access_token)
5 Get Charge status
respChargeStatus = clientOnA.OnaGetChargeStatus(partnerTxID, currency, respAuthCode.accessToken)
- refund online
response = clientOnA.OnaRefund(refundPartnerTxID, amount, origPartnerTxID, description, respAuthCode.accessToken, currency)
- Get Refund Status
response = clientOnA.OnaGetRefundStatus(partnerTxID, respAuthCode.accessToken, currency)
- Get One time charge status
response = clientOnA.OnaGetOTCStatus(partnerTxID, respAuthCode.accessToken, currency)
using Net.Public;
// ...
MerchantIntegrationOffline clientPos = new MerchantIntegrationOffline(stage, country, partner_id, partner_secret, merchant_id, terminal_id);
- Create QR Code
respCreateQRCode= clientPos.PosCreateQRCode(msgID, partnerTxID, amount, currency)
- Get transaction detail:
resp = clientPos.PosGetTxnStatus(msgID, partnerTxID, currency)
- Cancel a Transaction
resp = clientPos.PosCancel(msgID, partnerTxID, origPartnerTxID, origTxID, currency)
- Refund a POS Payment
resp = clientPos.PosRefund(msgID, refundPartnerTxID, amount, currency, origPartnerTxID, description)
- Get refund transaction detail:
resp = clientPos.PosGetRefundDetails(msgID, refundPartnerTxID, currency)
- Perform a Transaction
resp = clientPos.PosPerformQRCode(msgID, partnerTxID, amount, currency, code)
© 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).