Transactions Payment Methods Credit Card Submit Card Information
February 14, 2023 at 10:38 AMPay’nUP comes with integrated support to allow payments with credit cards. If you want our system can control this aspect, you only need send the customer’s credit card information.
The following example use CREDIT_CARD as payment method:
mutation ($input: SubmitTransactionInput!) {
transactions {
submit(input: $input) {
transaction {
id
number
status
date
total
response {
message
}
}
}
}
}
{
"input": {
"product": "ji12sd4c0a3D0=",
"inputs": {
"accountNumber": "+13051231234",
"amount": 50
},
"paymentMethod": "CREDIT_CARD",
"creditCard": {
"number":"370000000000002",
"cvv": "123",
"expMonth": 6,
"expYear": 2020,
"holder": {
"name": "Harvey Coulter",
"address1": "3383 Richland Avenue",
"city": "Kemah",
"state": "TX",
"zipCode": "77565",
"countryCode": "US"
}
}
}
}
{
"data": {
"transactions": {
"submit": {
"transaction": {
"id": "VlVkc2R3VlBSRVU5=",
"number": "00830981",
"status": "COMPLETED",
"date": "2018-06-08T21:34:49-04:00",
"total": 30,
"response": {
"message": "The phone +13051231234 has been recharged successfully with $30.00."
}
}
}
}
}
}
The following test credit card numbers will only work in the sandbox. Use any expiration date after today’s date. If the card code is required, please use any 3-digit combination for Visa, Mastercard, Discover, Diners Club, EnRoute, and JCB; use a 4-digit combination for American Express.
Test Card Brand | Number |
---|---|
American Express | 370000000000002 |
Discover | 6011000000000012 |
JCB | 3088000000000017 |
Diners Club/ Carte Blanche | 38000000000006 |
Visa | 4000000000000002 4007000000027 4012888818888 4111111111111111 |
Mastercard | 5424000000000015 2223000010309703 2223000010309711 |
To send card present transactions must send the magData
inside the creditCard.
Use the new line char \n
to separate track1 and track2 in the json, example:
"creditCard": {
"magData": "%B370000000000002^COULTER/HARVEY ^28082011608303780000000000000000?\n;391324348601008=120820116089750500000?"
}
The following magData are available for testing purposes:
VISA:
%B4000000000000002^COULTER/HARVEY ^2303201901000000000000981000000?
;391324348601008=120820116089750500000?
American Express:
%B370000000000002^COULTER/HARVEY ^28082011608303780000000000000000?
;391324348601008=120820116089750500000?
Failed Payment
If any error happen during the payment process the transaction will be declined and a error 2501 with payment gateway error message will be returned.
{
"errors": [
{
"code": 2501,
"tracking_id": "6857EFA9-02F9-1D8D-085C-4B72F64C",
"message": "The payment gateway declined the transaction because the expiration date is expired or does not match.",
"category": "user"
}
],
"data": {
"transactions": {
"submit": {
"transaction": {
"id": "VlVkc2R3VlBSR12a2=",
"number": "00830982",
"status": "FAILED",
"date": "2018-06-08T21:34:49-04:00",
"total": 30,
"response": null
}
}
}
}
}