Search Overlay

Cartes

Vous pouvez intégrer votre application de commerce électronique directement à notre API Paiements par carte, agnostique de plateforme, et traiter toutes les principales cartes de crédit par l’intermédiaire de la passerelle de paiement Paysafe.

Cliquez sur les liens ci-dessous pour voir nos exemples de code.

Vérifier l’accessibilité du service

is_online = client.card_payment_service.monitor
                                

Autoriser un paiement par carte

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

Traiter un achat par carte

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

Régler une autorisation de carte

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

Traiter un remboursement par carte

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

Vérifier un paiement par carte

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