Card Payments API

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

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

Authorize a Card Payment

Process an authorization
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)
Process a complex authorization
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)
Look up an authorization using an authorization ID
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)
Look up an authorization using a merchant reference number
auth_obj = Authorization(None)
auth_obj.merchantRefNum("5m8652wc1pirizft")
response_object = self.client.card_payments_service_handler().lookup_authorization_with_merchant_ref_no(auth_obj)

Process a Card Purchase

Process a purchase
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)
Void (reverse) an authorization
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)
Process a partial void (partial reversal)
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)
Look up a void (reversal) using an void ID (authorization reversal ID)
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)
Look up a void (reversal) using a merchant reference number
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)
Approve a held authorization
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)
Cancel a held authorization
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)

Settle a Card Authorization

Settle an authorization
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)
Cancel a settlement
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)
Look up a settlement using a settlement ID
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)
Look up a settlement using a merchant reference number
settlement_obj = Settlement(None)
settlement_obj. merchantRefNum("5m8652wc1pirizft")
response_object = self.client.card_payments_service_handler().lookup_settlement_with_merchant_no(settlement_obj)

Process a Card Refund

Process a refund
settlement_obj = Settlement(None)
settlement_obj.merchantRefNum("5m8652wc1pirizft")
response_object = self.client.card_payments_service_handler().create_refund(settlement_obj)
Look up a refund using a refund ID
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)
Look up a refund using a merchant reference number
refund_obj = Refund(None)
refund_obj. merchantRefNum("5m8652wc1pirizft")
response_object = self.client.card_payments_service_handler().lookup_refund_with_merchant_no(refund_obj)

Verify a Card Payment

Verify card and billing details
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)
Look up a verification using a verification ID
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)
Look up a verification using a merchant reference number
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)
Did you find this page useful?