By Nelson Suwal on Mar, 23, 2018
zipPay is a safe, simple and 100% interest-free account, which offers Buy now and Pay later. zipPay is owned by zipMoney Limited with all operations based in Sydney, Australia. Once customer has zipPay account, they can use their digital wallet to buy product without credit card and interest. Customers can buy upto $1000 (australian) and offers payment with four installments. The minimum repayment of at least $40 per month was required. A $5 monthly service fee will be added to the consumer’s account for any month there is an outstanding balance.
Integration requirement and process
The requirements to integrate zippay to the application: we need two accounts: one for merchant and another for customer. Here, merchant account records all transaction status, product details and provides the credential require to integrate zippay to our application. Merchant have right to capture amount, refund account and cancel order. For testing zipmoney provides sandbox merchant account.
Test Merchant Registration
For merchant sandbox account, we need to fill signup form on merchant website and need a confirmation from zipmoney team for approval of our request to create merchant account.
Once account is created, we will have the following information from our account:
For testing transaction between merchant and customer, We require zippay test account. ZipPay test account can be created from zipPay website. Before creating account, we need to have following details:
Integrating zipPay with Rails Application
To integrate with Rails Application, we can use zipMoney API for checkout, capture and refund.
We used gem: zipmoney-ruby-sdk
We need to add following on app/config:
require 'zipMoney' # Configure the api credentials ZipMoney::Configuration.merchant_id = ENV['MERCHANT_ID'] ZipMoney::Configuration.merchant_key = ENV['MERCHANT_KEY'] ZipMoney::Configuration.environment = ENV['ENVIRONMENT']
We can separate api operation by creating a separate services (app/services/zippay_handler.rb)
Class ZippayHandler # methods end
Checkout API will initialize order in zipmoney system and send request for checkout process and gives “redirect url” with successful response. The redirect url leads to zippay sign up or login form.
Checkout is initial process and we can initialize checkout object and send parameters required for the checkout process
def set_checkout checkout = ZipMoney::Checkout.new # we need send customer details order, order details, billing address, shipping address. checkout .params.required_attribute = ‘value’ . . . response = checkout.do() if response.isSuccess # do something else # do something # response.getError end end
Capture API will finalize the order and settle the fund. Authorize and capture method is being used for settling funds. This request is asynchronous request, that will return the response directly to the API request.
def set_caputer capture.params.required_attributes = ‘values’ . . response = capture.do() if response.isSuccess # do something else # do something # response.getError end end
Cancel API will cancel the order and will release the captured amount.
def set_cancel # we need to send transaction id, order information cancel = ZipMoney::Cancel.new cancel.params.required_attributes = ‘value’ . . response = cancel.do() if response.isSuccess # do something else # do something # response.getError end end
We can get order details, transaction amount from merchant account as response of the query
def set_order query = ZipMoney::Query.new query.params.orders = Struct::QueryOrder.new . . response = query.do() if response.isSuccess # do something else # do something # response.getError end end
Charged and capture amount can not be cancelled but can be refunded. This can be also done through merchant account.
def set_refund refund = ZipMoney::Refund.new refund.params.required_attributs = ‘values’ . . response = refund.do() if response.isSuccess # do something else # do something # response.getError end end
For more detail documentation and api information, you can follow following references:
Don't miss the next one!