Skip to content

ZoozPaymentsOS - A Java API connector for Zooz Payments

License

Notifications You must be signed in to change notification settings

mikeRozen/zoozPaymentsOSJava

Repository files navigation

ZoozPaymentsOSJava

Build License

A simple lightweight connector to ZoozPaymentsOS API Zooz. Check out the offcial Zooz API documentation to see all possible options.

Installation

You may use the Maven repository

<dependency>
  <groupId>com.dogiz</groupId>
  <artifactId>ZoozPaymentsOS</artifactId>
  <version>1.2</version>
</dependency> 

Please check the Dependencies

Example

ControllerSiteConfiguration configuration = new ControllerSiteConfiguration("appId", "publicKey", "privateKey",isSandbox);
controller = new Controller(configuration); 

//Create client by reference
 Customer customer = new Customer("ReferenceNumber");
 customer.setFirstName("Test1");
 customer.setEmail("test@gmail.con");
 Customer zoozCustomer = controller.customerCreate(customer);
 
 //Token creation
 PaymentMethod paymentMethod = new PaymentMethod();
 paymentMethod.setCardNumber("4580458045804580");
 paymentMethod.setCreditCardCvv("123");
 paymentMethod.setExpirationMonth("02");
 paymentMethod.setExpirationYear("21");
 paymentMethod.setHolderName("Test123");       
 PaymentMethod paymentMethodResponse = controller.createToken(paymentMethod);
 
 //Validate Card
  Payment payment = new Payment(1, "USD");
  payment.setCustomerId("Customer ID");
  payment = controller.paymentCreate(payment);
  Authorize authorization = new Authorize();
  PaymentMethod paymentMethod = new PaymentMethod();
  paymentMethod.setToken("Token");
  paymentMethod.setType("tokenized");
  authorization.setPaymentMethod(paymentMethod);
  AuthorizeResponse response = controller.autorizePayment(payment.getId(), authorization);
  VoidResponse voidResponse = controller.dismissAuthorization(payment.getId(), null); // Void the authorization (not necessary)
 
 //Charge
  Charge charge = controller.chargeApply("payment id", paymentMethod);
 
 //Associate Token to customer
  Customer customer = new Customer();
  customer.setId("customer id");
  PaymentMethod paymentMethod = controller.storeToken("token",customer);
 
 //Retrive Customer by refernce
  Customer customer = controller.customerByReference(reference);
 

Dependencies

Author

Michael Rozenblat

License

ZoozPaymentsOSJava is available under the MIT license. See the LICENSE file for more info.

About

ZoozPaymentsOS - A Java API connector for Zooz Payments

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages