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

response_object = self.client.card_payments_service_handler().monitor()
                                

Autoriser un paiement par carte

auth_obj = Authorization(None)
card_obj = Card(None)
cardExpiry_obj = CardExpiry(None)
billing_obj = BillingDetails(None)
auth_obj.merchantRefNum(RandomTokenGenerator().generateToken())
auth_obj.amount("1000")
card_obj.cardNum("4510150000000321")
card_obj.type("VI")
auth_obj.cvv("123")
cardExpiry_obj.month("06")
cardExpiry_obj.year("2018")
billing_obj.zip("C1009ABK")
auth_obj.billingDetails(billing_obj)
card_obj.cardExpiry(cardExpiry_obj)
auth_obj.card(card_obj)
response_object = self.client.card_payments_service_handler().create_authorization(auth_obj)

auth_obj = Authorization(None)
authentication_obj = Authentication(None)
card_obj = Card(None)
cardExpiry_obj = CardExpiry(None)
billing_obj = BillingDetails(None)
shipping_obj = ShippingDetails(None)
auth_obj.merchantRefNum(RandomTokenGenerator().generateToken())
auth_obj.amount("5")
auth_obj.settleWithAuth("false")
auth_obj.customerIp("204.91.0.12")
card_obj.cardNum("4530910000012345")
card_obj.cvv("123")
auth_obj.card(card_obj)
cardExpiry_obj.month("4")
cardExpiry_obj.year("2017")
card_obj.cardExpiry(cardExpiry_obj)
authentication_obj.eci("5")
authentication_obj.cavv("AAABCIEjYgAAAAAAlCNiENiWiV+=")
authentication_obj.xid("OU9rcTRCY1VJTFlDWTFESXFtTHU=")
authentication_obj.threeDEnrollment("Y")
authentication_obj.threeDResult("Y")
authentication_obj.signatureStatus("Y")
auth_obj.authentication(authentication_obj)
billing_obj.street("100 Queen Street West")
billing_obj.city("Toronto")
billing_obj.state("ON")
billing_obj.country("CA")
billing_obj.zip("M5H 2N2")
auth_obj.billingDetails(billing_obj)
shipping_obj.carrier("FEX")
shipping_obj.shipMethod("C")
shipping_obj.street("100 Queen Street West")
shipping_obj.city("Toronto")
shipping_obj.state("ON")
shipping_obj.country("CA")
shipping_obj.zip("M5H 2N2")
auth_obj.shippingDetails(shipping_obj)
response_object = self.client.card_payments_service_handler().create_authorization(auth_obj)

auth_obj = Authorization(None)
auth_obj.id("55b77870-266c-4796-bce1-008334aad424")
response_object = self.client.card_payments_service_handler().lookup_authorization_with_id(auth_obj)

auth_obj = Authorization(None)
auth_obj.merchantRefNum("5m8652wc1pirizft")
response_object = self.client.card_payments_service_handler().lookup_authorization_with_merchant_ref_no(auth_obj)

Traiter un remboursement par carte

auth_obj = Authorization(None)
card_obj = Card(None)
cardExpiry_obj = CardExpiry(None)
billing_obj = BillingDetails(None)
auth_obj.merchantRefNum(RandomTokenGenerator().generateToken())
auth_obj.amount("4000")
auth_obj.settleWithAuth("true")
card_obj.cardNum("4530910000012345")
card_obj.cvv("123")
auth_obj.card(card_obj)
cardExpiry_obj.month("2")
cardExpiry_obj.year("2017")
card_obj.cardExpiry(cardExpiry_obj)
billing_obj.zip("M5H 2N2")
auth_obj.billingDetails(billing_obj)
response_object = self.client.card_payments_service_handler().create_authorization(auth_obj)

auth_rev_obj = AuthorizationReversal(None)
auth_obj = Authorization(None)
auth_rev_obj.merchantRefNum(RandomTokenGenerator().generateToken())
auth_obj.id("ef8e4da6-68c1-40fb-ba43-d735148b1a7f")
auth_rev_obj.authorization(auth_obj)
response_object = self.client.card_payments_service_handler().reverse_authorization_using_merchant_no(auth_rev_obj)

auth_rev =  AuthorizationReversal(None)
auth_rev.merchantRefNum(RandomTokenGenerator().generateToken())
auth_rev.amount(222)
auth_obj = Authorization(None)
auth_obj.id("dea6fd3a-3e47-4b44-a303-c5c38f7104f6")
auth_rev.authorization(auth_obj)
response_object = self._client.card_payments_service_handler().reverse_authorization_using_merchant_no(auth_rev)

auth_rev_obj = AuthorizationReversal(None)
auth_rev_obj.id("55b77870-266c-4796-bce1-008334aad424")
response_object = self.client.card_payments_service_handler().lookup_authorization_reversal_with_id(auth_obj)

auth_rev_obj = AuthorizationReversal(None)
auth_obj.merchantRefNum("5m8652wc1pirizft")
response_object = self.client.card_payments_service_handler().lookup_authorization_reversal_with_merchant_no (auth_obj)

auth_obj = Authorization(None)
auth_obj.id("55b77870-266c-4796-bce1-008334aad424")
auth_obj.status("COMPLETED")
response_object = self.client.card_payments_service_handler().update_authorization(auth_obj)

auth_obj = Authorization(None)
auth_obj.id("55b77870-266c-4796-bce1-008334aad424")
auth_obj.status("CANCELLED")
response_object = self.client.card_payments_service_handler().lookup_authorization_with_id(auth_obj)

Régler une autorisation de carte

auth_obj = Authorization(None)
auth_obj.id("55b77870-266c-4796-bce1-008334aad424")
auth_obj.merchantRefNum("5m8652wc1pirizft")
auth_obj.amount("500")
response_object = self.client.card_payments_service_handler().settle_authorization(auth_obj)

settlement_obj = Settlement(None)
settlement_obj.status("CANCELLED")
settlement_obj.id("55b77870-266c-4796-bce1-008334aad424")
response_object = self.client.card_payments_service_handler().cancel_settlement(settlement_obj)

settlement_obj = Settlement(None)
settlement_obj.id("55b77870-266c-4796-bce1-008334aad424")
response_object = self.client.card_payments_service_handler().lookup_settlement_with_id(settlement_obj)

settlement_obj = Settlement(None)
settlement_obj. merchantRefNum("5m8652wc1pirizft")
response_object = self.client.card_payments_service_handler().lookup_settlement_with_merchant_no(settlement_obj)

Traiter un achat par carte

settlement_obj = Settlement(None)
settlement_obj.merchantRefNum("5m8652wc1pirizft")
response_object = self.client.card_payments_service_handler().create_refund(settlement_obj)

refund_obj = Refund(None)
refund_obj.id("55b77870-266c-4796-bce1-008334aad424")
response_object = self.client.card_payments_service_handler().lookup_refund_with_id(refund_obj)

refund_obj = Refund(None)
refund_obj. merchantRefNum("5m8652wc1pirizft")
response_object = self.client.card_payments_service_handler().lookup_refund_with_merchant_no(refund_obj)

Vérifier un paiement par carte

verify_obj = Verification(None)
card_obj = Card(None)
card_exp_obj = CardExpiry(None)
billing_obj = BillingDetails(None)
profile_obj = Profile(None)
verify_obj.merchantRefNum("4lnvozq01d1pbkr0")
card_obj.cardNum("4530910000012345")
card_obj.cvv("123")
verify_obj.card(card_obj)
card_exp_obj.month("02")
card_exp_obj.year("2017")
card_obj.cardExpiry(card_exp_obj)
billing_obj.zip("M5H 2N2")
verify_obj.billingDetails(billing_obj)
response_object = self.client.card_payments_service_handler().verify_card(verify_obj)

verify_obj = Verification(None)
verify_obj.id("dd655ad9-2ebe-4178-9b3f-c88707a193f3")
response_object = self.client.card_payments_service_handler().lookup_verification_using_id(verify_obj)

verify_obj = Verification(None)
verify_obj.merchantRefNum("4lnvozq01d1pbkr0")
pagination_obj = Pagination(None)
pagination_obj.limit = "4"
pagination_obj.offset = "0"
response_object = self.client.card_payments_service_handler().lookup_verification_using_merchant_ref_num(verify_obj, pagination_obj)