All Projects → imohsenb → ISO8583-Message-Client-java

imohsenb / ISO8583-Message-Client-java

Licence: MIT license
ISO8583 Message Packer and Unpacker with ISOClient in Java

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to ISO8583-Message-Client-java

React Interactive Paycard
Interactive React Paycard
Stars: ✭ 2,129 (+2164.89%)
Mutual labels:  payment
Easyupipayment Android
📱Android Library to implement UPI Payment integration easily in Android App 💳💸
Stars: ✭ 219 (+132.98%)
Mutual labels:  payment
react-stripe-script-loader
A React Component that loads Stripe script if necessary and shows React Stripe Elements
Stars: ✭ 22 (-76.6%)
Mutual labels:  payment
React Credit Cards
Beautiful credit cards for your payment forms
Stars: ✭ 2,239 (+2281.91%)
Mutual labels:  payment
Payment
Payment是php版本的支付聚合第三方sdk,集成了微信支付、支付宝支付、招商一网通支付。提供统一的调用接口,方便快速接入各种支付、查询、退款、转账能力。服务端接入支付功能,方便、快捷。
Stars: ✭ 2,293 (+2339.36%)
Mutual labels:  payment
Sdk3rd
第三方SDK集成库,授权/分享/支付
Stars: ✭ 249 (+164.89%)
Mutual labels:  payment
Mollie Api Node
Official Mollie API client for Node
Stars: ✭ 158 (+68.09%)
Mutual labels:  payment
terms-dictionary
Simple definitions of terms, acronyms, abbreviations, companies, and projects related to financial services and Moov.
Stars: ✭ 48 (-48.94%)
Mutual labels:  payment
Ach
ACH implements a reader, writer, and validator for Automated Clearing House (ACH) files. The HTTP server is available in a Docker image and the Go package is available.
Stars: ✭ 210 (+123.4%)
Mutual labels:  payment
ng-payment-card
💳 Responsive credit card component for Angular.
Stars: ✭ 27 (-71.28%)
Mutual labels:  payment
Zold
An Experimental Non-Blockchain Cryptocurrency for Fast Micro Payments
Stars: ✭ 183 (+94.68%)
Mutual labels:  payment
Parbad
A free, open-source, integrated and extensible library which connects your web applications to online payment gateways. Gateways can be added or developed by you.
Stars: ✭ 194 (+106.38%)
Mutual labels:  payment
recurly
A Recurly API client written in golang. Actively maintained and unit tested. No external dependencies.
Stars: ✭ 40 (-57.45%)
Mutual labels:  payment
Yrpayment
Better payment user experience library with cool animation in Swift
Stars: ✭ 176 (+87.23%)
Mutual labels:  payment
Chowder
Chowder for Android M-Pesa payments.
Stars: ✭ 31 (-67.02%)
Mutual labels:  payment
Commerce billing
A payment processing library for Elixir
Stars: ✭ 170 (+80.85%)
Mutual labels:  payment
Omnipay Pingpp
A Ping++ driver for the Omnipay PHP payment processing library. 一个聚合了支付宝(APP、Wap、PC、即时到账、扫码、企业付款),微信(APP、公众号、红包), 银联网关、银联企业网银、Apple Pay、QQ 钱包、易宝支付、百度钱包、京东支付、京东白条、招行一网通、分期支付等国内主流支付渠道的聚合支付网关(Ping++, also known as Pingpp/Pingxx/Pingplusplus)
Stars: ✭ 227 (+141.49%)
Mutual labels:  payment
java-api
Zold Java API
Stars: ✭ 20 (-78.72%)
Mutual labels:  payment
polardb-race
第一届POLARDB数据库性能大赛-初赛第5名(JAVA)-复赛第7名(CPP)
Stars: ✭ 24 (-74.47%)
Mutual labels:  nio
datoteka
A filesystem toolset and storage implementation for Clojure.
Stars: ✭ 59 (-37.23%)
Mutual labels:  nio

ISO-8583 Java Lib

ISO8583 Message Packer and Unpakcer with ISOClient for communication with iso server

(Supporting both Blocking IO and NIO)
(Supporting SSL/TLS)

A lightweight ISO8583 (is an international standard for financial transaction card originated interchange messaging - wikipedia ) library for Java and Android base on builder pattern and provide very simple use as you will see later.

  • Supporting Blocking IO and Non-blocking IO (NIO)
  • Supporting SSL/TLS
  • Base on Builder pattern
  • String not used for security reasons
  • Lightweight ISO-8583 lib for java and android
  • working with some enums, it's more readable
  • no dependency

Usage

Library will be available at Maven Centeral so you can add this dependency to your pom.xml like below:

<dependency>
    <groupId>com.imohsenb</groupId>
    <artifactId>ISO8583</artifactId>
    <version>1.0.5</version>
</dependency>

or direct download from HERE

ISOMessage

Create and pack an ISO message

To create an ISO message you must use ISOMessageBuilder which produce iso message for you:

ISOMessage isoMessage = ISOMessageBuilder.Packer(VERSION.V1987)
                .networkManagement()
                .mti(MESSAGE_FUNCTION.Request, MESSAGE_ORIGIN.Acquirer)
                .processCode("920000")
                .setField(FIELDS.F11_STAN,  "1")
                .setField(FIELDS.F12_LocalTime,  "023120")
                .setField(FIELDS.F13_LocalDate,  "0332")
                .setField(FIELDS.F24_NII_FunctionCode,  "333")
                .setHeader("1002230000")
                .build();
                

with ISOMessageBuilder.Packer(VERSION.V1987) you can build iso message as you can see above. the 'Packer' method return 8 method for 8 iso message class (authorization, financial, networkManagment, ...) based on ISO8583 after that you can set message function and message origin by mti method. mti method accept string and enums as parameter, and I think enums are much clear and readable. As you know an iso message need a 'Processing Code' and you can set it's value by `processCode' method, and then we can start setting required fields by 'setField' method and accept String and enums as field number parameter. After all, you must call build method to generate iso message object.

Unpack a buffer and parse it to ISO message

For unpacking a buffer received from server you need to use ISOMessageBuilder.Unpacker():

ISOMessage isoMessage = ISOMessageBuilder.Unpacker()
                                    .setMessage(SAMPLE_HEADER + SAMPLE_MSG)
                                    .build();

Working with ISOMessage object

ISOMessage object has multiple method provide fields, message body, header and ... for security reason they will return byte array exept .toString and .getStringField method, because Strings stay alive in memory until a garbage collector will come to collect that. but you can clear byte or char arrays after use and calling garbage collector is not important anymore. If you use Strings, taking memory dumps will be dangerous.

    byte[] body = isoMessage.getBody();
    byte[] trace = isoMessage.getField(11);
    String trace = isoMessage.getStringField(FIELDS.F11_STAN);

ISOClient

Sending message to iso server

Sending message to iso server and received response from server can be done with ISOClient in many ways:

ISOClient client = ISOClientBuilder.createSocket(HOST, PORT)
                .build();

        client.connect();
        String response = Arrays.toString(client.sendMessageSync(new SampleIsoMessage()));
        System.out.println("response = " + response);
        client.disconnect();

Sending over SSL/TLS

Sending a message to ISO server over SSL/TLS is more complicated, especially with NIO methods. but I try to make it more simple and usefull:

ISOClient client = ISOClientBuilder.createSocket(HOST, PORT)
                                .enableSSL()
                                .setSSLProtocol("TLSv1.2")
                                .setKeyManagers(km.getKeyManagers())
                                .setTrustManagers(null)
                                .build();

it's enough to adding .enableSSL() and another requirement parameters before .build() and may you need to prepare KeyStore and another things before. TrustManagers can be null.

Send a message with NIO benefits!

NIO (stands for non-blocking I/O) is a collection of Java programming language APIs that offer features for intensive I/O operations - wikipedia. It's so simple to use in this library just see below : 😎

ISOClient client = ISOClientBuilder.createSocket(HOST, PORT)
                .configureBlocking(false)
                .build();

😁😁‚ it's ready for use, with just set .configureBlocking to false. it is posibble to use with .enableSSL() too.

License

Copyright 2018 Mohsen Beiranvand

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].