Skip to content

Instantly share code, notes, and snippets.

@gvsrini
Forked from medikoo/tiw-maxcom-api.md
Created July 4, 2014 14:09
Show Gist options
  • Save gvsrini/610abd976e6935d92a2e to your computer and use it in GitHub Desktop.
Save gvsrini/610abd976e6935d92a2e to your computer and use it in GitHub Desktop.

TIW <-> MaxCom data exchange API

Shared Secret string used to validate requests: B117F156FDFEE0AEF47AC2D2B9743057DFA1A75A999B76221AB3FC0A9862792E

API of MaxCom service

Initialization of payment transaction

Request data
Property nameDescriptionValue format
emailEmailValid email, max 100 characters
mobileNoMobile numberFull country code, only dialling digits, no symbols e.g. 48693427795
businessIdTIW unique business id, provided by MaxComExactly: 1
customerNameCustomer nameString, only A-Za-z0-9 and space, max 100 chars
amountAmount to be charged in TShPositive integer
txnIdTransaction id, unique, generated by TIWPositive integer, Max 11 digits
paymentMethodChosen payment method (either Credit Card or Mobile Money)One of the tokens: cc, mp
hashCodeMD5 Hash of Shared Secret + amount + businessId + customerName + email + mobileNo + txnId MD5 Hash
Response
Status: 201 Created
Location: https://online.maxcomafrica.com/???

Where Status is a HTTP Status, any other (not 201) HTTP status code should not be handled (failure should be assumed).

Location is HTTP header specifying to which page on MaxCom website we should redirect user.

Cancellation of payment transaction

Request data
Property nameDescriptionValue format
txnIdTransaction idas at initialization
hashCodeMD5 Hash of Shared Secret + txnId MD5 Hash
Response
Status: 200 OK

Where Status is a HTTP Status, any other (not 200) HTTP status code should not be handled (failure should be assumed).

API of TIW service

Resolution of payment

Request data
Property nameDescriptionValue format
txnIdTransaction Idas at initialization
statusStatus (approved or rejected)One of the following tokens: approved, cancelled, rejected
responseMessageHuman friendly description of a statusMax 200 characters
receiptNoReceipt NumberMax 20 characters
hashCodeMD5 Hash of Shared Secret + amount + receiptNo + responseMessage + status + txnId MD5 Hash
Response
Status: 200 OK

Where Status is a HTTP Status, any other (not 200) HTTP status code should not be handled (failure should be assumed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment