-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
335 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module EzpayInvoice | ||
module Api | ||
module Endpoints | ||
module AllowanceInvalid | ||
def allowance_invalid(payload = {}) | ||
post( | ||
'allowanceInvalid', | ||
EzpayInvoice::Api::Payloads::AllowanceInvalid.new(payload) | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module EzpayInvoice | ||
module Api | ||
module Endpoints | ||
module AllowanceIssue | ||
def allowance_issue(payload = {}) | ||
post( | ||
'allowance_issue', | ||
EzpayInvoice::Api::Payloads::AllowanceIssue.new(payload) | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module EzpayInvoice | ||
module Api | ||
module Endpoints | ||
module AllowanceTouchIssue | ||
def allowance_touch_issue(payload = {}) | ||
post( | ||
'allowance_touch_issue', | ||
EzpayInvoice::Api::Payloads::AllowanceTouchIssue.new(payload) | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module EzpayInvoice | ||
module Api | ||
module Endpoints | ||
module InvoiceInvalid | ||
def invoice_invalid(payload = {}) | ||
post( | ||
'invoice_invalid', | ||
EzpayInvoice::Api::Payloads::InvoiceInvalid.new(payload) | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module EzpayInvoice | ||
module Api | ||
module Endpoints | ||
module InvoiceIssue | ||
def invoice_issue(payload = {}) | ||
post( | ||
'invoice_issue', | ||
EzpayInvoice::Api::Payloads::InvoiceIssue.new(payload) | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module EzpayInvoice | ||
module Api | ||
module Endpoints | ||
module InvoiceSearch | ||
def invoice_search(payload = {}) | ||
post( | ||
'invoice_search', | ||
EzpayInvoice::Api::Payloads::InvoiceSearch.new(payload) | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module EzpayInvoice | ||
module Api | ||
module Endpoints | ||
module InvoiceTouchIssue | ||
def invoice_touch_issue(payload = {}) | ||
post( | ||
'invoice_touch_issue', | ||
EzpayInvoice::Api::Payloads::InvoiceTouchIssue.new(payload) | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require_relative 'payloads/base' | ||
require_relative 'payloads/invoice_issue' | ||
require_relative 'payloads/invoice_touch_issue' | ||
require_relative 'payloads/invoice_invalid' | ||
require_relative 'payloads/invoice_search' | ||
require_relative 'payloads/allowance_issue' | ||
require_relative 'payloads/allowance_touch_issue' | ||
require_relative 'payloads/allowance_invalid' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module EzpayInvoice | ||
module Api | ||
module Payloads | ||
class AllowanceInvalid < Base | ||
property(:Version, from: :version, default: '1.0') | ||
property(:AllowanceNo, from: :allowance_no, required: true) | ||
property(:InvalidReason, from: :invalid_reason, required: true) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module EzpayInvoice | ||
module Api | ||
module Payloads | ||
class AllowanceIssue < Base | ||
include EzpayInvoice::Api::Properties::Item | ||
|
||
property(:Version, from: :version, default: '1.3') | ||
property(:InvoiceNo, from: :invoice_no, required: true) | ||
property(:MerchantOrderNo, from: :merchant_order_no, required: true) | ||
property(:TaxTypeForMixed, from: :tax_type_for_mixed) | ||
property( | ||
:ItemTaxAmt, | ||
from: :item_tax_amt, | ||
with: ->(value) { value.join('|') }, | ||
required: true | ||
) | ||
property(:TotalAmt, from: :total_amt, required: true) | ||
property(:BuyerEmail, from: :buyer_email) | ||
property(:Status, from: :status, required: true) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module EzpayInvoice | ||
module Api | ||
module Payloads | ||
class AllowanceTouchIssue < Base | ||
property(:Version, from: :version, default: '1.0') | ||
property(:AllowanceStatus, from: :allowance_status, required: true) | ||
property(:AllowanceNo, from: :allowance_no, required: true) | ||
property(:MerchantOrderNo, from: :merchant_order_no, required: true) | ||
property(:TotalAmt, from: :total_amt, required: true) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require 'hashie' | ||
|
||
module EzpayInvoice | ||
module Api | ||
module Payloads | ||
class Base < Hashie::Dash | ||
include Hashie::Extensions::IgnoreUndeclared | ||
include Hashie::Extensions::Dash::PropertyTranslation | ||
include EzpayInvoice::Api::Properties::General | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module EzpayInvoice | ||
module Api | ||
module Payloads | ||
class InvoiceInvalid < Base | ||
property(:Version, from: :version, default: '1.0') | ||
property(:InvoiceNumber, from: :invoice_number, required: true) | ||
property(:InvalidReason, from: :invalid_reason, required: true) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module EzpayInvoice | ||
module Api | ||
module Payloads | ||
class InvoiceIssue < Base | ||
include EzpayInvoice::Api::Properties::Item | ||
|
||
property(:Version, from: :version, default: '1.4') | ||
property(:TransNum, from: :trans_num) | ||
property(:MerchantOrderNo, from: :merchant_order_no, required: true) | ||
property(:Status, from: :status, required: true) | ||
property(:CreateStatusTime, from: :create_status_time) | ||
property(:Category, from: :category, required: true) | ||
property(:BuyerName, from: :buyer_name, required: true) | ||
property(:BuyerUBN, from: :buyer_ubn) | ||
property(:BuyerAddress, from: :buyer_address) | ||
property(:BuyerEmail, from: :buyer_email) | ||
property(:CarrierType, from: :carrier_type) | ||
property(:CarrierNum, from: :carrier_num) | ||
property(:LoveCode, from: :love_code) | ||
property(:PrintFlag, from: :print_flag, required: true) | ||
property(:KioskPrintFlag, from: :kiosk_print_flag) | ||
property(:TaxType, from: :tax_type, required: true) | ||
property(:TaxRate, from: :tax_rate, required: true) | ||
property(:CustomsClearance, from: :customs_clearance) | ||
property(:Amt, from: :amt, required: true) | ||
property(:AmtSales, from: :amt_sales) | ||
property(:AmtZero, from: :amt_zero) | ||
property(:AmtFree, from: :amt_free) | ||
property(:TaxAmt, from: :tax_amt, required: true) | ||
property(:TotalAmt, from: :total_amt, required: true) | ||
property( | ||
:ItemTaxType, | ||
from: :item_tax_type, | ||
with: ->(value) { value.join('|') }, | ||
) | ||
property(:Comment, from: :comment) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module EzpayInvoice | ||
module Api | ||
module Payloads | ||
class InvoiceSearch < Base | ||
property(:Version, from: :version, default: '1.3') | ||
property(:SearchType, from: :search_type) | ||
property(:MerchantOrderNo, from: :merchant_order_no, required: true) | ||
property(:TotalAmt, from: :total_amt, required: true) | ||
property(:InvoiceNumber, from: :invoice_number, required: true) | ||
property(:RandomNum, from: :random_num, required: true) | ||
property(:DisplayFlag, from: :display_flag) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module EzpayInvoice | ||
module Api | ||
module Payloads | ||
class InvoiceTouchIssue < Base | ||
property(:Version, from: :version, default: '1.0') | ||
property(:TransNum, from: :trans_num) | ||
property(:MerchantOrderNo, from: :merchant_order_no, required: true) | ||
property(:InvoiceTransNo, from: :invoice_trans_no, required: true) | ||
property(:TotalAmt, from: :total_amt, required: true) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require_relative 'properties/general' | ||
require_relative 'properties/item' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module EzpayInvoice | ||
module Api | ||
module Properties | ||
module General | ||
def self.included(base) | ||
base.class_eval do | ||
property :RespondType, from: :respond_type, default: 'JSON' | ||
property :TimeStamp, from: :timestamp, default: Time.now.to_i | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
module EzpayInvoice | ||
module Api | ||
module Properties | ||
module Item | ||
def self.included(base) | ||
base.class_eval do | ||
property( | ||
:ItemName, | ||
from: :item_name, | ||
with: ->(value) { value.join('|') }, | ||
required: true | ||
) | ||
property( | ||
:ItemCount, | ||
from: :item_count, | ||
with: ->(value) { value.join('|') }, | ||
required: true | ||
) | ||
property( | ||
:ItemUnit, | ||
from: :item_unit, | ||
with: ->(value) { value.join('|') }, | ||
required: true | ||
) | ||
property( | ||
:ItemPrice, | ||
from: :item_price, | ||
with: ->(value) { value.join('|') }, | ||
required: true | ||
) | ||
property( | ||
:ItemAmt, | ||
from: :item_amt, | ||
with: ->(value) { value.join('|') }, | ||
required: true | ||
) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters