Search Overlay

Cards

You can integrate your e-commerce application directly to our platform-agnostic Card Payments API and process all major credit cards through the Paysafe payment gateway.

Click the links below to view our code samples.

Verify That the Service Is Accessible

is_online = client.card_payment_service.monitor
                                

Authorize a Card Payment

auth_obj = Paysafe::CardPayments::Authorization.new ({
merchantRefNum: "0f8fad5bd9cb469fa16570867728950e",
amount: 555,
card: {
cardNum: 4111111111111111,
cvv: 123,
cardExpiry: {
month: "06",
year: "2020"
}
},
billingDetails: {
zip: "M5H 2N2"
}
})

response = client.card_payment_service.authorize auth_obj

auth_obj = Paysafe::CardPayments::Authorization.new ({
merchantRefNum: "0f8fad5bd9cb469fa16570867728950e",
amount: 555,
settleWithAuth: false,
card: {
cardNum: 4111111111111111,
cvv: 123,
cardExpiry: {
month: "06",
year: "2020"
}
}, authentication: {
eci: 5,
cavv: "AAABCIEjYgAAAAAAlCNiENiWiV+=",
xid: "OU9rcTRCY1VJTFlDWTFESXFtTHU=",
threeDEnrollment: "Y",
threeDResult: "Y",
signatureStatus: "Y"
},
billingDetails: {
street: "100 Queen Street West",
city: "Toronto",
state: "ON",
country: "CA",
zip: "M5H 2N2"
},
shippingDetails: {
carrier: "UPS",
shipMethod: "N",
street: "100 Queen Street West",
city: "Toronto",
state: "ON",
country: "CA",
zip: "M5H 2N2",
},
customerIp: "204.91.0.12",
description: "Got U a video"
})

response = client.card_payment_service.authorize auth_obj

auth_obj = Paysafe::CardPayments::Authorization.new ({
merchantRefNum: "0f8fad5bd9cb469fa16570867728950e"
})

response = client.card_payment_service.get_auths auth_obj

auth_obj = Paysafe::CardPayments::Authorization.new ({
merchantRefNum: "0f8fad5bd9cb469fa16570867728950e"
})

response = client.card_payment_service.get_auths auth_obj

Process a Card Purchase

auth_obj = Paysafe::CardPayments::Authorization.new ({
merchantRefNum: "0f8fad5bd9cb469fa16570867728950e",
amount: 555,
settleWithAuth: true,
card: {
cardNum: 4111111111111111,
cvv: 123,
cardExpiry: {
month: "06",
year: "2020"
}
},
billingDetails: {
zip: "M5H 2N2"
}
})

response = client.card_payment_service.authorize auth_obj

auth_reversal = Paysafe::CardPayments::AuthorizationReversal.new ({
merchantRefNum: "0f8fad5bd9cb469fa16570867728950e",
amount: 555,
authorizationID: auth_id
})

response = client.card_payment_service.reverse_auth auth_reversal

auth_reversal = Paysafe::CardPayments::AuthorizationReversal.new ({
merchantRefNum: "0f8fad5bd9cb469fa16570867728950e",
amount: 222,
authorizationID: auth_id
})

response = client.card_payment_service.reverse_auth auth_reversal

auth_reversal = Paysafe::CardPayments::AuthorizationReversal.new ({
id: auth_reversal_id
})

response = client.card_payment_service.get_auth_reversal auth_reversal

auth_reversal = Paysafe::CardPayments::AuthorizationReversal.new ({
merchantRefNum: "0f8fad5bd9cb469fa16570867728950e"
})

response = client.card_payment_service.get_auth_reversals auth_reversal

auth_obj = Paysafe::CardPayments::Authorization.new ({
id: auth_id
})

client.card_payment_service.approve_held_auth auth_obj

auth_obj = Paysafe::CardPayments::Authorization.new ({
id: auth_id
})

client.card_payment_service.cancel_held_auth auth_obj

Settle a Card Authorization

settle_obj = Paysafe::CardPayments::Settlement.new ({
merchantRefNum: "0f8fad5bd9cb469fa16570867728950e",
authorizationID: auth_id
})

response = client.card_payment_service.settlement settle_obj

settle_obj = Paysafe::CardPayments::Settlement.new ({
id: settlement_id
})

response = client.card_payment_service.cancel_settlement settle_obj

settle_obj = Paysafe::CardPayments::Settlement.new ({
id: settlement_id
})

response = client.card_payment_service.get_settlement settle_obj

settle_obj = Paysafe::CardPayments::Settlement.new ({
merchantRefNum: settlement_merchant_ref_num
})

response = client.card_payment_service.get_settlements settle_obj

Process a Card Refund

refund_obj = Paysafe::CardPayments::Refund.new ({
merchantRefNum: "0f8fad5bd9cb469fa16570867728950e",
settlementID: settlement_id
})

response = client.card_payment_service.refund refund_obj

refund_obj = Paysafe::CardPayments::Refund.new ({
id: refund_id
})

response = client.card_payment_service.get_refund refund_obj

refund_obj = Paysafe::CardPayments::Refund.new ({
merchantRefNum: refund_merchant_ref_num
})

response = client.card_payment_service.get_refunds refund_obj

Verify a Card Payment

verify_obj = Paysafe::CardPayments::Verification.new ({
merchantRefNum: "0f8fad5bd9cb469fa16570867728950e",
card: {
cardNum: 4111111111111111,
cvv: 123,
cardExpiry: {
month: "06",
year: "2020"
}
},
profile: {
firstName: "Joe",
lastName: "Smith",
email: "Joe.Smith@canada.com"
},
billingDetails: {
street: "100 Queen Street West",
city: "Toronto",
state: "ON",
country: "CA",
zip: "M5H2N2"
},
customerIp: "204.91.0.12",
description: "This is a test transaction"
})

response = client.card_payment_service.verify verify_obj

verify_obj = Paysafe::CardPayments::Verification.new ({
id: verification_id
})

response = client.card_payment_service.get_verification verify_obj

verify_obj = Paysafe::CardPayments::Verification.new ({
merchantRefNum: verification_merchant_ref_num
})

response = client.card_payment_service.get_verifications verify_obj