more info at https://doc.gbprimepay.com for python docs see https://thanakijwanavit.github.io/globalPrimePay/
Install
pip install globalPrimePay
How to use
- Get gbprime secrets
pip install globalPrimePay- python docs here
Secrets
GB prime should give you a password file which should include
this should also be available at your gbprime console in
profile>show Keynear the bottom of the page
public:Public Keysecret: Secret Key
token: Token / Customer Key
These key should be saved securely and should never be shared with the client or stored in the source code
We recommend a secret storage service such as aws secrets manager
if you are developing your app please use the test domain key
these secrets must be used when initiating the gbp client
from globalPrimePay.client import Client
client = Client(pub = 'PUBLICKEY', secret='SECRETKEY', token='CLIENT TOKEN')
sampleCard = {
"cardNumber": "4535017710535741",
"expirationMonth": "05",
"expirationYear": "28",
"securityCode": "184",
"name": "Watcharagon Phokonwong"
}
cardToken = client.getCardToken(**sampleCard)['card']['token']
cardToken
client.chargeCard(
token = cardToken,
amount = 100,
referenceNo = 'ref1',
customerName = "nic",
customerEmail = "nicsemail@gmail.com",
detail = 'test order')
chargeCardResult = client.chargeCard(
token = cardToken,
amount = 100,
referenceNo = 'ref1',
customerName = "nic",
customerEmail = "nicsemail@gmail.com",
detail = 'test order',
otp = 'Y'
)
chargeCardResult
client.verifyOtp(chargeCardResult['gbpReferenceNo'])