GithubHelp home page GithubHelp logo

szantogab / szamla-agent Goto Github PK

View Code? Open in Web Editor NEW

This project forked from letscodehu/szamla-agent

0.0 1.0 0.0 169 KB

Java client to communicate with szamlazz.hu API

License: MIT License

Java 100.00%

szamla-agent's Introduction

Szamla-Agent

Java client implementation against the szamlazz.hu billing API.

Usage:

As a usual client you should instantiate hu.letscode.billing.service.factory.BillingServiceFactory and then create your own service with createSzamlaAgent method by passing two previously created objects:

BillingServiceFactory serviceFactory = new BillingServiceFactory();
SzamlaAgentBillingService billingService = serviceFactory.createSzamlaAgent();

The hu.letscode.billing.domain.Seller contains information about the selling entity.

Seller seller = new Seller();
seller.setAccountNumber("555555555-55555555-55555555");
seller.setBankName("whateverbank");
seller.setEmailContent("Pay your bill please");
seller.setEmailSubject("Invoice");
seller.setSellerSignatory("John Doe");

The hu.letscode.billing.domain.Settings contains information about the account you registered at szamlazz.hu and using szamlazz client with.

Settings settings = new Settings();
settings.setAnswerType(2);
settings.setDownloadBill(false);
settings.seteBill(false);
settings.setUser("letscodehu");
settings.setPassword("password");
settings.setKeyChainPassword("");

When you got the service up and running you could invoice bills with the createBill method. You only need to create BillingRequest's.

BillingRequest billingRequest = new BillingRequest();
billingRequest.setBuyer(createBuyer());
billingRequest.setSeller(createSeller());
billingRequest.setSettings(setSettings());
billingRequest.setHeader(createHeader());
billingRequest.setItems(createItemList());

billingService.createBill(billingRequest);

In order to create storno invoices you should use the revokeBill method. For that you need to construct BillRevokeRequests which is similar to the billingrequest and pass it over to the method:

BillRevokeRequest billingRequest = new BillRevokeRequest();
billingRequest.setBuyer(createBuyer());
billingRequest.setSeller(createSeller());
billingRequest.setHeader(createHeader());
billingRequest.setSettings(createSettings());

billingService.revokeBill(billingRequest);

Note that the revoke and create buyer/seller/header and settings objects are different.

TODO:

  • Remove seller and settings from the client
  • Refactor requests to immutable ones
  • Create builders for requests
  • Implement client side validation for requests.
  • Registering a credit entry
  • Querying the invoice PDF
  • Querying the invoice XML
  • Deleting pro forma invoice
  • Generating a receipt
  • Reversing a receipt
  • Querying a receipt
  • Sending a receipt
  • Querying taxpayers

szamla-agent's People

Contributors

dependabot[bot] avatar letscodehu avatar tacsiazuma avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.