README.md in dpd_api-0.0.1 vs README.md in dpd_api-0.1.0

- old
+ new

@@ -1,10 +1,15 @@ DpdApi ====== :small_red_triangle_down: Ruby implementation for [DPD](http://dpd.ru)'s SOAP API +[![Gem Version](https://badge.fury.io/rb/dpd_api.svg)](http://badge.fury.io/rb/dpd_api) +[![Build Status](https://travis-ci.org/itsNikolay/dpd_api.svg)](https://travis-ci.org/itsNikolay/dpd_api) +[![Code Climate](https://codeclimate.com/github/itsNikolay/dpd_api/badges/gpa.svg)](https://codeclimate.com/github/itsNikolay/dpd_api) +[![Test Coverage](https://codeclimate.com/github/itsNikolay/dpd_api/badges/coverage.svg)](https://codeclimate.com/github/itsNikolay/dpd_api) + Installation ------------ ### Rails @@ -14,11 +19,10 @@ ``` ```ruby # config/initializers/dpd_api.rb DpdApi.configure do |config| - # your dpd's given client key and client number config.client_key = 'ASD7686ASD76786786786786AASD' config.client_number = '123456789' config.base_url = Rails.env.production? ? 'http://ws.dpd.ru' : 'http://wstest.dpd.ru' end ``` @@ -49,10 +53,44 @@ DpdApi::Calculator.service_cost(params) #=> [{:service_code=>"TEN", :service_name=>"DPD 10:00", :cost=>"2228.67", :days=>"4"}, {:service_code=>"DPT", :service_name=>"DPD 13:00", :cost=>"1966.47", :days=>"4"}, . . .] ``` +Table of content +---------------- +* [NOTES](#notes) +* [DpdApi::Geography](#dpdapigeography) + * [.cities_cash_pay](#cities_cash_pay) + * [.terminals_self_delivery](#terminals_self_delivery) + * [.parcel_shops](#parcel_shops) +* [DpdApi::Calculator](#dpdapicalculator) + * [.service_cost](#service_cost) + * [.service_cost_by_parcels](#service_cost_by_parcels) +* [DpdApi::Order](#dpdapiorder) + * [.create_order](#create_order) + * [.order_status](#order_status) + * [.create_address](#create_address) + * [.update_address](#update_address) + * [.cancel_order](#cancel_order) + * [.add_parcels](#add_parcels) + * [.remove_parcels](#remove_parcels) + * [.invoice_file](#invoice_file) +* [DpdApi::Tracing](#dpdapitracing) + * [.states_by_client_order](#states_by_client_order) + * [.states_by_client_parcel](#states_by_client_parcel) + * [.states_by_dpd_order](#states_by_dpd_order) +* [DpdApi::Nl](#dpdapinl) + * [.nl_amount](#nl_amount) + * [.nl_invoice](#nl_invoice) +* [DpdApi::LabelPrint](#dpdapilabelprint) + * [.create_label_file](#create_label_file) + +Notes +----- +1. The gem is based on gem [savon](https://github.com/savonrb/savon) v.2 +2. Naming: java's `#getOrderStatus` becomes ruby's `#order_status` + Getting started --------------- ### DpdApi::Geography matches `/services/geography?wsdl` in DPD SOAP API @@ -462,7 +500,54 @@ params = { client_parcel_nr: '987654321', } DpdApi::Tracing.states_by_dpd_order(params) + +``` + + +### DpdApi::Nl +matches `/services/nl?wsdl` in DPD SOAP API + +####.nl_amount +matches `getNLAmount` +```ruby +params = { + date_from: Time.now - 1.days, + date_to: Time.now + 1 days, + } + +DpdApi::Tracing.nl_amount(params) + +``` +####.nl_invoice +matches `getNLInvoice` +```ruby +params = { + date_from: Time.now - 1.days, + date_to: Time.now + 1 days, + } + +DpdApi::Tracing.nl_invoice(params) + +``` + + +### DpdApi::LabelPrint +matches `/services/label-print?wsdl` in DPD SOAP API + +####.create_label_file +matches `createLabelFile` +```ruby +params = { + file_format: 'PDF', + page_size: 'A5', + order: [ + order_num: '10160002MOW', + parcels_number: '2', + ], + } + +DpdApi::Tracing.create_label_file(params) ```