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

bool isOnline = client.cardPaymentService().monitor();
                                

Authorize a Card Payment

Authorization auth = Authorization.Builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.amount(555)
.card()
.cardNum("4111111111111111")
.cvv("123")
.cardExpiry()
.month(06)
.year(2020)
.Done()
.Done()
.billingDetails()
.zip("M5H 2N2")
.Done()
.Build();

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

Authorization auth = Authorization.Builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.amount(6666)
.settleWithAuth(false)
.card()
.cardNum("4111111111111111")
.cvv("123")
.cardExpiry()
.month(06)
.year(2020)
.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 = client.cardPaymentService().authorize(auth);

Authorization response = client.cardPaymentService().get(new Authorization(auth.id()));
                                

Pagerator<Authorization> auths = client.cardPaymentService().getAuths(Authorization.Builder()
.merchantRefNum(auth.merchantRefNum())
.Build());

Process a Card Purchase

Authorization auth = Authorization.Builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.amount(555)
.settleWithAuth(true)
.card()
.cardNum("4111111111111111")
.cvv("123")
.cardExpiry()
.month(06)
.year(2020)
.Done()
.Done()
.billingDetails()
.zip("M5H 2N2")
.Done()
.Build();

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

AuthorizationReversal authReversal = AuthorizationReversal.Builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.amount(555)
.authorizationId(auth.id())
.Build();

AuthorizationReversal response = client.cardPaymentService().reverseAuth(authReversal);

AuthorizationReversal authReversal = AuthorizationReversal.Builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.amount(222)
.authorizationId(auth.id())
.Build();

AuthorizationReversal response = client.cardPaymentService().reverseAuth(authReversal);

AuthorizationReversal response = client.cardPaymentService().get(new AuthorizationReversal(authReversal.id()));
                                

Pagerator<AuthorizationReversal> authReversals = client.cardPaymentService().getAuthReversals(AuthorizationReversal.Builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.Build());

client.cardPaymentService().approveHeldAuth(new Authorization(auth.id()));
                                

client.cardPaymentService().cancelHeldAuth(new Authorization(auth.id()));
                                

Settle a Card Authorization

Settlement settle = Settlement.Builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.authorizationId(auth.id())
.Build();

Settlement response = client.cardPaymentService().settlement(settle);

Settlement response = client.cardPaymentService().cancelSettlement(settlement);
                                

Settlement response = client.cardPaymentService().get(new Settlement(settlement.id()));
                                

Pagerator<Settlement> settlements = client.cardPaymentService().getSettlements(Settlement.Builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.Build());

Process a Card Refund

client.cardPaymentService().refund(Refund.Builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.settlementId(settlement.id())
.Build());

Refund response = client.cardPaymentService().get(new Refund(refund.id()));
                                

Pagerator<Refund> refunds = client.cardPaymentService().getRefunds(Refund.Builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.Build());

Verify a Card Payment

Verification ver = Verification.Builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.card()
.cardNum("4111111111111111")
.cardExpiry()
.month(DateTime.Now.Month)
.year(DateTime.Now.Year)
.Done()
.cvv("123")
.Done()
.profile()
.firstName("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("204.91.0.12")
.description("This is a test transaction")
.Build();

Verification response = client.cardPaymentService().verify(ver);

Verification response = client.cardPaymentService().get(new Verification(verify.id()));
                                

Pagerator<Verification> refunds = client.cardPaymentService().getVerifications(Verification.Builder()
.merchantRefNum("0f8fad5bd9cb469fa16570867728950e")
.Build());