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.

Le segment level2level3 de la SDK Java ne prend pas en charge les éléments de ligne multiples. 

Vérifier l’accessibilité du service

boolean isOnline = apiClient.cardPaymentService().monitor();
                                

Autoriser un paiement par carte

Authorization auth =
Authorization.builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.amount(555)
.card()
.cardNum("4111111111111111")
.cvv(123)
.cardExpiry()
.month(2)
.year(2017)
.done()
.done()
.billingDetails()
.zip("M5H 2N2")
.done()
.build();

Authorization response = apiClient.cardPaymentService().authorize(auth);

Authorization auth =
Authorization.builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.amount(6666)
.settleWithAuth(false)
.card()
.cardNum("4111111111111111")
.cvv(123)
.cardExpiry()
.month(2)
.year(2017)
.done()
.done()
.authentication()
.eci(5)
.cavv("AAABCIEjYgAAAAAAlCNiENiWiV+=")
.xid("OU9rcTRCY1VJTFlDWTFESXFtTHU=")
.threeDEnrollment("Y")
.threeDResult("Y")
.signatureStatus("Y")
.done()
.billingDetails()
.street("100 Queen Street West")
.city("Toronto")
.state("ON")
.country("CA")
.zip("M5H 2N2")
.done()
.shippingDetails()
.carrier("UPS")
.shipMethod("N")
.street("100 Queen Street West")
.city("Toronto")
.state("ON")
.country("CA")
.zip("M5H 2N2")
.done()
.customerIp("204.91.0.12")
.description("Got U a video")
.build();

Authorization response = apiClient.cardPaymentService().authorize(auth);

Authorization authResponse = apiClient.cardPaymentService().getAuth(auth.getId());
                                

AuthorizationQuery newAuth =
AuthorizationQuery.builder()
.account(accountNumber)
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.build();

AuthorizationResultSet auths = apiClient.cardPaymentService().query(newAuth);

Traiter un achat par carte

Authorization auth =
Authorization.builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.amount(10098)
.settleWithAuth(true)
.card()
.cardNum("4111111111111111")
.cvv(123)
.cardExpiry()
.month(2)
.year(2023)
.done()
.done()
.billingDetails()
.zip("M5H 2N2")
.done()
.build();

apiClient.cardPaymentService().authorize(auth);

Authorization authResponse = makeAuthRequest("processAuthReversal");

AuthorizationReversal voidAuth =
AuthorizationReversal.builder()
.merchantRefNum(authResponse.getMerchantRefNum())
.amount(555)
.authorizationId(authResponse.getId())
.build();

AuthorizationReversal voidAuthResponse = apiClient.cardPaymentService().voidAuth(voidAuth);

Authorization authResponse = makeAuthRequest("processPartialAuthReversal");

AuthorizationReversal voidAuth =
AuthorizationReversal.builder()
.merchantRefNum(authResponse.getMerchantRefNum())
.authorizationId(authResponse.getId())
.amount(333)
.build();

AuthorizationReversal voidAuthResponse = apiClient.cardPaymentService().voidAuth(voidAuth);

AuthorizationReversalId authLookup = auth.getId();
AuthorizationReversal authLookupResponse = apiClient.cardPaymentService().getAuthReversal(authLookup);

AuthorizationReversalQuery authLookup =
AuthorizationReversalQuery.builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.build();

AuthorizationReversalResultSet results = apiClient.cardPaymentService().query(authLookup);

apiClient.cardPaymentService().approveHeldAuth(auth.getId());
                                

apiClient.cardPaymentService().cancelHeldAuth(auth.getId());
                                

Régler une autorisation de carte

Settlement settlement =
Settlement.builder()
.authorizationId(auth.getId())
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.build();

Settlement settlementResponse = apiClient.cardPaymentService().settlement(settlement);

apiClient.cardPaymentService().cancelSettlement(settlementResponse.getId());
                                

Settlement settleLookupResponse = apiClient.cardPaymentService().getSettlement(settlementResponse.getId());
                                

SettlementQuery querySettlements =
SettlementQuery.builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.build();

SettlementResultSet settlements = apiClient.cardPaymentService().query(querySettlements);

Traiter un remboursement par carte

Refund refund = Refund.builder()
.settlementId(settlement.getId())
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.build();

Refund refundResponse = apiClient.cardPaymentService().refund(refund);

Refund refundResponse = apiClient.cardPaymentService().getRefund(refund.getId());
                                

RefundQuery query = RefundQuery.builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.build();

RefundResultSet refundResultSet = apiClient.cardPaymentService().query(query);

Vérifier un paiement par carte

Verification verification =
Verification.builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.card()
.cardNum("4111111111111111")
.cardExpiry()
.month(3)
.year(2023)
.done()
.cvv( "234" )
.done()
.profile()
.firstName(getRandomChars("Joe"))
.lastName("Smith")
.email("Joe.Smith@canada.com")
.done()
.billingDetails()
.street("100 Queen Street West")
.city("Toronto")
.state("ON")
.country("CA")
.zip("M5H2N2")
.done()
.customerIp("209.91.0.12")
.description("This is a test transaction")
.build();

Verification verificationResponse = apiClient.cardPaymentService().verify(verification);

Verification verificationResponse = apiClient.cardPaymentService().getVerification(verification.getId());
                                

VerificationQuery queryVerification =
VerificationQuery.builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.build();

VerificationResultSet verifications = apiClient.cardPaymentService().query(queryVerification);