taiwan_payments 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +24 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.ja.md +293 -0
  5. data/README.md +291 -0
  6. data/README.zh-TW.md +293 -0
  7. data/docs/ecpay-invoices.md +202 -0
  8. data/docs/ecpay-payments.md +191 -0
  9. data/docs/glossary/concepts.ja.md +33 -0
  10. data/docs/glossary/concepts.md +34 -0
  11. data/docs/glossary/ecpay-invoice.ja.md +113 -0
  12. data/docs/glossary/ecpay-invoice.md +114 -0
  13. data/docs/glossary/ecpay-payment.ja.md +64 -0
  14. data/docs/glossary/ecpay-payment.md +65 -0
  15. data/docs/rails.md +184 -0
  16. data/docs/sandbox-setup.md +104 -0
  17. data/docs/taiwan-payments-101.ja.md +138 -0
  18. data/docs/taiwan-payments-101.md +138 -0
  19. data/docs/taiwan-payments-101.zh-TW.md +138 -0
  20. data/docs/testing.md +140 -0
  21. data/docs/webhooks.md +113 -0
  22. data/exe/taiwan_payments +6 -0
  23. data/lib/generators/taiwan_payments/install/install_generator.rb +41 -0
  24. data/lib/generators/taiwan_payments/install/templates/ecpay_controller.rb.tt +26 -0
  25. data/lib/generators/taiwan_payments/install/templates/initializer.rb.tt +38 -0
  26. data/lib/taiwan_payments/cli.rb +271 -0
  27. data/lib/taiwan_payments/configuration.rb +86 -0
  28. data/lib/taiwan_payments/credentials.rb +27 -0
  29. data/lib/taiwan_payments/decimal.rb +36 -0
  30. data/lib/taiwan_payments/ecpay/aes_cipher.rb +36 -0
  31. data/lib/taiwan_payments/ecpay/check_mac_value.rb +63 -0
  32. data/lib/taiwan_payments/ecpay/checkout.rb +154 -0
  33. data/lib/taiwan_payments/ecpay/invoice_client.rb +253 -0
  34. data/lib/taiwan_payments/ecpay/invoice_mapper.rb +222 -0
  35. data/lib/taiwan_payments/ecpay/payment_client.rb +188 -0
  36. data/lib/taiwan_payments/ecpay/payment_methods.rb +40 -0
  37. data/lib/taiwan_payments/ecpay/payment_notification.rb +127 -0
  38. data/lib/taiwan_payments/ecpay/response_body.rb +30 -0
  39. data/lib/taiwan_payments/ecpay/trade_info.rb +68 -0
  40. data/lib/taiwan_payments/ecpay.rb +19 -0
  41. data/lib/taiwan_payments/environment.rb +22 -0
  42. data/lib/taiwan_payments/error_codes/ecpay_invoice.yml +80 -0
  43. data/lib/taiwan_payments/error_codes/ecpay_payment.yml +59 -0
  44. data/lib/taiwan_payments/error_codes.rb +23 -0
  45. data/lib/taiwan_payments/errors.rb +71 -0
  46. data/lib/taiwan_payments/form_helper.rb +21 -0
  47. data/lib/taiwan_payments/glossary/concepts.yml +122 -0
  48. data/lib/taiwan_payments/glossary/ecpay_invoice.yml +523 -0
  49. data/lib/taiwan_payments/glossary/ecpay_payment.yml +278 -0
  50. data/lib/taiwan_payments/glossary.rb +106 -0
  51. data/lib/taiwan_payments/hosted_form.rb +46 -0
  52. data/lib/taiwan_payments/http_client.rb +62 -0
  53. data/lib/taiwan_payments/instrumentation.rb +42 -0
  54. data/lib/taiwan_payments/invoice.rb +235 -0
  55. data/lib/taiwan_payments/money.rb +32 -0
  56. data/lib/taiwan_payments/php_compat.rb +39 -0
  57. data/lib/taiwan_payments/railtie.rb +23 -0
  58. data/lib/taiwan_payments/redactor.rb +29 -0
  59. data/lib/taiwan_payments/taipei_time.rb +42 -0
  60. data/lib/taiwan_payments/tax_id.rb +26 -0
  61. data/lib/taiwan_payments/testing.rb +152 -0
  62. data/lib/taiwan_payments/validation.rb +56 -0
  63. data/lib/taiwan_payments/version.rb +5 -0
  64. data/lib/taiwan_payments/webhooks.rb +54 -0
  65. data/lib/taiwan_payments.rb +67 -0
  66. metadata +118 -0
@@ -0,0 +1,122 @@
1
+ # Terms a developer meets when taking payments and issuing invoices in Taiwan.
2
+ # docs/glossary/concepts.md is generated from this file by `rake docs:glossary`.
3
+ title: Taiwan payment and invoice terms
4
+ title_zh: 台灣金流與發票名詞解釋
5
+ title_ja: 台湾の決済・発票用語集
6
+ reference: https://www.einvoice.nat.gov.tw/
7
+ fields:
8
+ Uniform invoice:
9
+ zh: 統一發票
10
+ en: The government-regulated receipt every business must issue for a sale. Each one carries a number that enters a bimonthly state lottery, which is why consumers want theirs.
11
+ ja: すべての事業者が販売のたびに発行しなければならない、政府が定めた領収書です。各発票の番号が 2 か月ごとの公営宝くじ(統一発票の宝くじ)の抽せん対象になるため、消費者は発票を受け取りたがります。
12
+ gem: '`TaiwanPayments::Invoice`'
13
+ E-invoice:
14
+ zh: 電子發票
15
+ en: A uniform invoice issued electronically through a certified provider such as ECPay, which reports it to the Ministry of Finance.
16
+ ja: ECPay(綠界科技)などの認定プロバイダーを通じて電子的に発行する統一発票です。発票のデータはプロバイダーが財政部へ報告します。
17
+ gem: '`ECPay::InvoiceClient`'
18
+ Tax ID:
19
+ zh: 統一編號(統編)
20
+ en: The 8-digit number identifying a company or organisation. A buyer gives theirs when they need a business invoice for their accounts.
21
+ ja: 会社や団体を識別する 8 桁の番号です。購入者は、経理処理のために事業者向けの発票が必要な場合に自社の番号を伝えます。
22
+ gem: '`buyer: {tax_id:}`, `TaxId.valid?`'
23
+ Carrier:
24
+ zh: 載具
25
+ en: Where a paperless invoice is stored for the buyer, so lottery prizes can be matched to them.
26
+ ja: ペーパーレスの発票を購入者のために保存しておく場所です。これにより、宝くじの当せん金を本人に結び付けられます。
27
+ gem: '`carrier:`'
28
+ Mobile barcode:
29
+ zh: 手機條碼
30
+ en: The most common carrier. A code such as /ABC+123 that a person registers once with the Ministry of Finance and shows at every purchase.
31
+ ja: 最も一般的なキャリアです。/ABC+123 のようなコードで、個人が財政部に一度登録しておき、買い物のたびに提示します。
32
+ gem: '`carrier: "/ABC+123"`'
33
+ Citizen digital certificate:
34
+ zh: 自然人憑證
35
+ en: A government-issued ID smart card whose number (2 letters and 14 digits) can serve as a carrier.
36
+ ja: 政府が発行する IC カード型の身分証明書です。その番号(英字 2 文字と数字 14 桁)をキャリアとして利用できます。
37
+ gem: '`carrier: "AB12345678901234"`'
38
+ Member carrier:
39
+ zh: 會員載具
40
+ en: A carrier run by the invoice provider itself, keyed by the buyer's email or phone. The default when the buyer gives no carrier.
41
+ ja: 発票プロバイダー自身が運営するキャリアで、購入者のメールアドレスまたは電話番号で識別します。購入者がキャリアを指定しない場合の既定値です。
42
+ gem: '`carrier: :member`'
43
+ Donation code:
44
+ zh: 捐贈碼(愛心碼)
45
+ en: A 3 to 7 digit code for a registered charity. The buyer gives the invoice, and any lottery prize, to the charity.
46
+ ja: 登録済みの慈善団体を表す 3〜7 桁のコードです。購入者は発票を、当せんした場合の賞金も含めてその団体に寄付します。
47
+ gem: '`donation_code:`'
48
+ Random number:
49
+ zh: 隨機碼
50
+ en: A 4-digit code on each invoice that, with the invoice number, lets the buyer look it up.
51
+ ja: 各発票に記載される 4 桁のコードです。発票番号と組み合わせることで、購入者が発票を照会できます。
52
+ gem: '`random_number`'
53
+ Invoice number track:
54
+ zh: 字軌
55
+ en: The range of invoice numbers the tax office assigns a business for each two-month period. A provider cannot issue once the range runs out.
56
+ ja: 税務当局が 2 か月の期間ごとに事業者へ割り当てる発票番号の範囲です。範囲を使い切ると、プロバイダーは発票を発行できなくなります。
57
+ gem: '`ApiError` codes 1500047 and 5070350'
58
+ Void:
59
+ zh: 作廢
60
+ en: Cancelling an invoice entirely. Only possible within the two-month period it was issued in.
61
+ ja: 発票全体を取り消すことです。発票を発行した 2 か月の期間内に限り可能です。
62
+ gem: '`void`'
63
+ Allowance:
64
+ zh: 折讓
65
+ en: A credit note against an invoice, used for partial refunds and for returns after the period has closed.
66
+ ja: 発票に対して発行する減額伝票(クレジットノート)です。一部返金や、2 か月の期間が締め切られた後の返品に使います。
67
+ gem: '`allowance`'
68
+ Taxable, zero-rated, exempt:
69
+ zh: 應稅、零稅率、免稅
70
+ en: The three tax treatments. Taxable is the normal 5% business tax, zero-rated is mostly exports, exempt covers certain goods and services.
71
+ ja: 3 種類の課税区分です。課税は通常の 5% の営業税、ゼロ税率は主に輸出、免税は特定の商品やサービスが対象です。
72
+ gem: '`tax_type:`'
73
+ Merchant:
74
+ zh: 特店
75
+ en: A business with a payment provider account. The vendors call your account a 特店 and its ID the 特店編號.
76
+ ja: 決済プロバイダーのアカウントを持つ事業者です。各ベンダーはこのアカウントを「特店」、その ID を「特店編號」と呼びます。
77
+ gem: '`merchant_id:`'
78
+ Convenience store code:
79
+ zh: 超商代碼
80
+ en: A code the customer types into a kiosk at 7-ELEVEN, FamilyMart, Hi-Life or OK Mart and then pays in cash at the counter.
81
+ ja: 購入者が 7-ELEVEN、FamilyMart、Hi-Life、OK Mart の店頭端末に入力するコードです。入力後、レジで現金で支払います。
82
+ gem: '`payment_method: :cvs`'
83
+ Convenience store barcode:
84
+ zh: 超商條碼
85
+ en: Three barcodes the customer shows at the counter to pay in cash.
86
+ ja: 購入者がレジで提示して現金で支払うための 3 つのバーコードです。
87
+ gem: '`payment_method: :barcode`'
88
+ Virtual account:
89
+ zh: 虛擬帳號
90
+ en: A one-off bank account number generated for an order. The customer transfers to it from an ATM or online banking.
91
+ ja: 注文ごとに生成される 1 回限りの銀行口座番号です。購入者は ATM またはオンラインバンキングからこの口座に振り込みます。
92
+ gem: '`payment_method: :atm`'
93
+ WebATM:
94
+ zh: 網路 ATM
95
+ en: Paying from a bank card through a card reader attached to the customer's computer.
96
+ ja: 購入者のパソコンに接続したカードリーダーを使い、銀行のキャッシュカードで支払う方法です。
97
+ gem: '`payment_method: :web_atm`'
98
+ Capture:
99
+ zh: 關帳(請款)
100
+ en: Settling an authorised card payment so the money is actually collected. Automatic for most merchants.
101
+ ja: オーソリ(与信)済みのカード決済を確定し、実際に代金を回収する処理です。ほとんどの加盟店では自動で行われます。
102
+ gem: '`capture`'
103
+ Refund:
104
+ zh: 退刷(退款)
105
+ en: Returning money on a captured card payment.
106
+ ja: 売上確定済みのカード決済の代金を返すことです。
107
+ gem: '`refund`'
108
+ Instalments:
109
+ zh: 分期付款
110
+ en: Card payment spread over 3 to 30 months, widely used in Taiwan and often interest-free for the customer.
111
+ ja: カード決済を 3〜30 か月に分けて支払う方法です。台湾では広く使われており、購入者には無利息の場合も多くあります。
112
+ gem: '`installments:`'
113
+ Reward points:
114
+ zh: 紅利折抵
115
+ en: Paying part of a purchase with credit card reward points.
116
+ ja: 購入代金の一部をクレジットカードのポイントで支払うことです。
117
+ gem: '`redeem:`'
118
+ Simulated payment:
119
+ zh: 模擬付款
120
+ en: A button in the vendor's back office, in production as well as in testing, that sends a fake "paid" callback without any money moving.
121
+ ja: ベンダーの管理画面にあるボタンで、テスト環境だけでなく本番環境にもあります。お金を動かさずに、偽の「支払い済み」コールバックを送信します。
122
+ gem: '`simulated?`'
@@ -0,0 +1,523 @@
1
+ # ECPay B2C e-invoice fields: ECPay's name, its Chinese label in ECPay's
2
+ # documentation, what it means, and where it appears in this gem.
3
+ # docs/glossary/ecpay-invoice.md is generated from this file by `rake docs:glossary`.
4
+ title: ECPay e-invoice fields
5
+ title_zh: 綠界 B2C 電子發票欄位對照表
6
+ title_ja: ECPay 電子発票のフィールド一覧
7
+ reference: https://developers.ecpay.com.tw/7896/
8
+ fields:
9
+ MerchantID:
10
+ zh: 特店編號
11
+ en: Merchant ID for the e-invoice product. Not the same as the payment merchant ID.
12
+ ja: 電子発票サービス用の加盟店 ID です。決済用の加盟店 ID とは別のものです。
13
+ gem: '`merchant_id:` on the client'
14
+ PlatformID:
15
+ zh: 特約合作平台商代號
16
+ en: Platform merchant ID, only for platforms issuing on behalf of sub-merchants.
17
+ ja: プラットフォーム加盟店 ID です。配下の加盟店に代わって発票を発行するプラットフォーム専用です。
18
+ gem: '`platform_id:` on the client'
19
+ RqHeader:
20
+ zh: 傳入資料
21
+ en: Request header object. Holds the Timestamp.
22
+ ja: リクエストヘッダーのオブジェクトです。Timestamp を含みます。
23
+ gem: 'set automatically'
24
+ Timestamp:
25
+ zh: 傳入時間
26
+ en: Unix time of the request. ECPay rejects it after ten minutes.
27
+ ja: リクエストの Unix 時間です。10 分を過ぎると ECPay に拒否されます。
28
+ gem: 'set automatically'
29
+ Data:
30
+ zh: 加密資料
31
+ en: The request or response fields as JSON, URL-encoded, AES-128-CBC encrypted and Base64 encoded.
32
+ ja: リクエストまたはレスポンスのフィールドを JSON にして URL エンコードし、AES-128-CBC で暗号化したうえで Base64 エンコードしたものです。
33
+ gem: 'encrypted and decrypted automatically'
34
+ RpHeader:
35
+ zh: 回傳資料
36
+ en: Response header object.
37
+ ja: レスポンスヘッダーのオブジェクトです。
38
+ gem: 'not used'
39
+ RqID:
40
+ zh: 傳輸編號
41
+ en: ECPay's ID for the request. Quote it when asking ECPay support about a call.
42
+ ja: ECPay がリクエストに付ける ID です。API 呼び出しについて ECPay のサポートに問い合わせるときに伝えてください。
43
+ gem: 'not used'
44
+ Revision:
45
+ zh: 串接規格文件版號
46
+ en: API specification revision.
47
+ ja: API 仕様書のリビジョンです。
48
+ gem: 'not used'
49
+ TransCode:
50
+ zh: 回傳代碼
51
+ en: Whether ECPay could read the request at all. 1 is yes. Failures raise ApiError with a code such as T110.
52
+ ja: ECPay がリクエストを読み取れたかどうかを表します。1 は読み取れたことを示します。失敗した場合は、T110 などのコードを持つ ApiError が発生します。
53
+ gem: '`ApiError#code`'
54
+ TransMsg:
55
+ zh: 回傳訊息
56
+ en: Message for TransCode.
57
+ ja: TransCode に対応するメッセージです。
58
+ gem: '`ApiError#message`'
59
+ RtnCode:
60
+ zh: 回應代碼
61
+ en: Result of the operation. 1 is success. Anything else raises ApiError.
62
+ ja: 操作の結果です。1 は成功です。それ以外の場合は ApiError が発生します。
63
+ gem: '`ApiError#code`'
64
+ RtnMsg:
65
+ zh: 回應訊息
66
+ en: ECPay's message for the result, in Chinese.
67
+ ja: 結果に対する ECPay のメッセージです。中国語で返されます。
68
+ gem: '`ApiError#message_zh`'
69
+ RelateNumber:
70
+ zh: 特店自訂編號
71
+ en: Your unique reference for the invoice, up to 50 characters. Usually the order number.
72
+ ja: 加盟店側で発票に付ける一意の参照番号で、最大 50 文字です。通常は注文番号を使います。
73
+ gem: '`order_no:`'
74
+ CustomerID:
75
+ zh: 客戶編號
76
+ en: Your own ID for the customer.
77
+ ja: 加盟店側で管理している顧客 ID です。
78
+ gem: '`buyer: {customer_id:}`'
79
+ CustomerIdentifier:
80
+ zh: 統一編號
81
+ en: Buyer's 8-digit company tax ID. Present on a business invoice, empty on a consumer one.
82
+ ja: 購入者の会社の統一編号(8 桁)です。事業者向けの発票では値が入り、消費者向けの発票では空です。
83
+ gem: '`buyer: {tax_id:}`'
84
+ CustomerName:
85
+ zh: 客戶名稱
86
+ en: Buyer's name. Required on a printed invoice.
87
+ ja: 購入者の名前です。印刷する発票では必須です。
88
+ gem: '`buyer: {name:}`'
89
+ CustomerAddr:
90
+ zh: 客戶地址
91
+ en: Buyer's address. Required on a printed invoice.
92
+ ja: 購入者の住所です。印刷する発票では必須です。
93
+ gem: '`buyer: {address:}`'
94
+ CustomerPhone:
95
+ zh: 客戶手機號碼
96
+ en: Buyer's mobile number, digits only. Either this or the email is required.
97
+ ja: 購入者の携帯電話番号で、数字のみです。この項目かメールアドレスのどちらかが必須です。
98
+ gem: '`buyer: {phone:}`'
99
+ CustomerEmail:
100
+ zh: 客戶電子信箱
101
+ en: Buyer's email. ECPay sends the invoice notice here.
102
+ ja: 購入者のメールアドレスです。ECPay が発票の通知をここに送信します。
103
+ gem: '`buyer: {email:}`'
104
+ ClearanceMark:
105
+ zh: 通關方式
106
+ en: For zero-rated sales. 1 did not go through customs, 2 went through customs.
107
+ ja: ゼロ税率の販売で指定します。1 は税関を経由していない、2 は税関を経由したことを表します。
108
+ gem: '`customs_clearance:`'
109
+ Print:
110
+ zh: 列印註記
111
+ en: 1 when the buyer gets a paper invoice, 0 otherwise.
112
+ ja: 購入者に紙の発票を渡す場合は 1、それ以外は 0 です。
113
+ gem: '`print:`'
114
+ Donation:
115
+ zh: 捐贈註記
116
+ en: 1 when the invoice is donated to a charity.
117
+ ja: 発票を慈善団体に寄付する場合は 1 です。
118
+ gem: 'set when `donation_code:` is given'
119
+ LoveCode:
120
+ zh: 捐贈碼
121
+ en: The charity's 3 to 7 digit donation code.
122
+ ja: 慈善団体の 3〜7 桁の寄付コード(愛心碼)です。
123
+ gem: '`donation_code:`'
124
+ CarrierType:
125
+ zh: 載具類別
126
+ en: Where a paperless invoice is stored. Empty for none, 1 ECPay member carrier, 2 citizen digital certificate, 3 mobile barcode.
127
+ ja: ペーパーレスの発票の保存先です。空はキャリアなし、1 は ECPay の会員キャリア、2 は自然人憑証(自然人憑證)、3 はモバイルバーコード(手機條碼)です。
128
+ gem: '`carrier:`'
129
+ CarrierNum:
130
+ zh: 載具編號
131
+ en: The carrier's number, such as /ABC+123 for a mobile barcode. Empty for the member carrier.
132
+ ja: キャリアの番号です。モバイルバーコードの場合は /ABC+123 のような値です。会員キャリアの場合は空です。
133
+ gem: '`carrier:`'
134
+ TaxType:
135
+ zh: 課稅類別
136
+ en: 1 taxable, 2 zero-rated, 3 exempt, 9 mixed.
137
+ ja: 1 は課税、2 はゼロ税率、3 は免税、9 は混合です。
138
+ gem: '`tax_type:`'
139
+ ZeroTaxRateReason:
140
+ zh: 零稅率原因
141
+ en: Statutory reason for a zero-rated sale, a code from 71 to 79.
142
+ ja: ゼロ税率の販売の法定理由で、71 から 79 のコードです。
143
+ gem: '`zero_tax_rate_reason:`'
144
+ SpecialTaxType:
145
+ zh: 特種稅額類別
146
+ en: Category for special-tax businesses. Most shops never use it.
147
+ ja: 特種税額の対象となる事業者向けの区分です。ほとんどの店舗では使いません。
148
+ gem: '`extra: {"SpecialTaxType" => ...}`'
149
+ SalesAmount:
150
+ zh: 發票總金額(含稅)
151
+ en: Invoice total in TWD, tax included.
152
+ ja: 発票の合計金額(税込)です。単位は新台湾ドル(TWD)です。
153
+ gem: '`Invoice#total`'
154
+ InvoiceRemark:
155
+ zh: 發票備註
156
+ en: Note printed on the invoice.
157
+ ja: 発票に印字される備考です。
158
+ gem: '`remark:`'
159
+ Items:
160
+ zh: 商品
161
+ en: The invoice lines.
162
+ ja: 発票の品目(明細行)です。
163
+ gem: '`items:`'
164
+ ItemSeq:
165
+ zh: 商品序號
166
+ en: Line number, starting at 1.
167
+ ja: 品目の行番号です。1 から始まります。
168
+ gem: 'set automatically'
169
+ ItemName:
170
+ zh: 商品名稱
171
+ en: Line description.
172
+ ja: 品目の説明(品名)です。
173
+ gem: '`items: [{name:}]`'
174
+ ItemCount:
175
+ zh: 商品數量
176
+ en: Quantity.
177
+ ja: 数量です。
178
+ gem: '`items: [{quantity:}]`'
179
+ ItemWord:
180
+ zh: 商品單位
181
+ en: Unit, up to 6 characters. Defaults to 式, the customary catch-all.
182
+ ja: 単位で、最大 6 文字です。既定値は、慣例として何にでも使える「式」です。
183
+ gem: '`items: [{unit:}]`'
184
+ ItemPrice:
185
+ zh: 商品單價
186
+ en: Unit price, tax included.
187
+ ja: 単価(税込)です。
188
+ gem: '`items: [{unit_price:}]`'
189
+ ItemTaxType:
190
+ zh: 商品課稅別
191
+ en: Tax type of one line. Only differs between lines on a mixed invoice.
192
+ ja: 品目ごとの課税区分です。品目によって異なるのは、混合の発票の場合だけです。
193
+ gem: '`items: [{tax_type:}]`'
194
+ ItemAmount:
195
+ zh: 商品合計
196
+ en: Line total, tax included.
197
+ ja: 品目の合計金額(税込)です。
198
+ gem: '`items: [{amount:}]`'
199
+ ItemRemark:
200
+ zh: 商品備註
201
+ en: Note for the line.
202
+ ja: 品目の備考です。
203
+ gem: '`items: [{remark:}]`'
204
+ InvType:
205
+ zh: 字軌類別
206
+ en: 07 general tax, 08 special tax.
207
+ ja: 07 は一般税額、08 は特種税額です。
208
+ gem: '`"07"`; override with `extra:`'
209
+ vat:
210
+ zh: 商品單價是否含稅
211
+ en: 1 when prices include tax, which is how the gem always sends them.
212
+ ja: 価格が税込の場合は 1 です。gem は常に税込で送信します。
213
+ gem: '`"1"`; override with `extra:`'
214
+ InvoiceNo:
215
+ zh: 發票號碼
216
+ en: The invoice number, two letters and eight digits.
217
+ ja: 発票番号です。英字 2 文字と数字 8 桁です。
218
+ gem: '`invoice_no`'
219
+ InvoiceDate:
220
+ zh: 發票開立時間
221
+ en: When the invoice was issued. Lookups, voids and allowances need the date part.
222
+ ja: 発票の発行日時です。照会、無効化(作廢)、折譲(折讓、発行後の減額)には日付部分が必要です。
223
+ gem: '`issued_at`, `issued_on:`'
224
+ RandomNumber:
225
+ zh: 隨機碼
226
+ en: Four-digit code printed on the invoice. Buyers use it with the invoice number to look the invoice up.
227
+ ja: 発票に印字される 4 桁のコードです。購入者は発票番号と組み合わせて発票を照会します。
228
+ gem: '`random_number`'
229
+ Reason:
230
+ zh: 作廢原因
231
+ en: Why the invoice or allowance is being voided, up to 20 characters.
232
+ ja: 発票または折譲を無効化する理由で、最大 20 文字です。
233
+ gem: '`reason:`'
234
+ AllowanceNotify:
235
+ zh: 通知類別
236
+ en: How the buyer hears about an allowance. S for SMS, E for email, A for both, N for none.
237
+ ja: 折譲を購入者に通知する方法です。S は SMS、E はメール、A は両方、N は通知なしです。
238
+ gem: 'chosen from `email:` and `phone:`'
239
+ NotifyMail:
240
+ zh: 通知電子信箱
241
+ en: Email address for the allowance notice.
242
+ ja: 折譲の通知先のメールアドレスです。
243
+ gem: '`email:`'
244
+ NotifyPhone:
245
+ zh: 通知手機號碼
246
+ en: Mobile number for the allowance notice.
247
+ ja: 折譲の通知先の携帯電話番号です。
248
+ gem: '`phone:`'
249
+ AllowanceAmount:
250
+ zh: 折讓單總金額(含稅)
251
+ en: Total being credited, tax included.
252
+ ja: 折譲の合計金額(税込)です。
253
+ gem: 'computed from `items:`'
254
+ AllowanceNo:
255
+ zh: 折讓編號
256
+ en: Number of the allowance to void.
257
+ ja: 無効化する折譲の番号です。
258
+ gem: '`allowance_no:`'
259
+ IA_Allow_No:
260
+ zh: 折讓單號
261
+ en: Number of the allowance just issued.
262
+ ja: 今回発行された折譲の番号です。
263
+ gem: '`allowance_no`'
264
+ IA_Invoice_No:
265
+ zh: 發票號碼
266
+ en: Invoice the allowance belongs to.
267
+ ja: 折譲の対象となる発票の番号です。
268
+ gem: '`invoice_no`'
269
+ IA_Date:
270
+ zh: 折讓時間
271
+ en: When the allowance was issued.
272
+ ja: 折譲の発行日時です。
273
+ gem: '`issued_at`'
274
+ IA_Remain_Allowance_Amt:
275
+ zh: 折讓剩餘金額
276
+ en: What can still be credited against the invoice.
277
+ ja: その発票に対して、まだ折譲できる残りの金額です。
278
+ gem: '`remaining_amount`'
279
+ DelayFlag:
280
+ zh: 延遲註記
281
+ en: 1 issues automatically after DelayDay days. 2 waits to be triggered.
282
+ ja: 1 は DelayDay で指定した日数の経過後に自動で発行し、2 はトリガーされるまで待機します。
283
+ gem: '`schedule(days:)`'
284
+ DelayDay:
285
+ zh: 延遲天數
286
+ en: Days to wait before issuing, up to 15.
287
+ ja: 発行までの待機日数で、最大 15 日です。
288
+ gem: '`schedule(days:)`'
289
+ Tsr:
290
+ zh: 交易單號
291
+ en: Your handle for a scheduled invoice, up to 30 characters. Used to trigger it.
292
+ ja: 予約発票に加盟店側で付ける参照番号で、最大 30 文字です。発行をトリガーするときに使います。
293
+ gem: '`reference:`'
294
+ PayType:
295
+ zh: 交易類別
296
+ en: Always 2.
297
+ ja: 常に 2 です。
298
+ gem: 'set automatically'
299
+ PayAct:
300
+ zh: 交易類別名稱
301
+ en: Always ECPAY.
302
+ ja: 常に ECPAY です。
303
+ gem: 'set automatically'
304
+ NotifyURL:
305
+ zh: 開立完成時通知特店系統的網址
306
+ en: ECPay POSTs here once a scheduled invoice has been issued.
307
+ ja: 予約発票が発行されると、ECPay がここへ POST します。
308
+ gem: '`notify_url:`'
309
+ OrderNumber:
310
+ zh: 交易單號
311
+ en: Echo of Tsr in the scheduling response.
312
+ ja: 予約発行のレスポンスで返される、Tsr と同じ値です。
313
+ gem: '`ScheduledInvoice#reference`'
314
+ BarCode:
315
+ zh: 手機條碼
316
+ en: Mobile barcode to check with the Ministry of Finance.
317
+ ja: 財政部に照会して確認するモバイルバーコードです。
318
+ gem: '`mobile_barcode_valid?`'
319
+ IsExist:
320
+ zh: 是否存在
321
+ en: Y when the donation code or mobile barcode is registered.
322
+ ja: 寄付コードまたはモバイルバーコードが登録されている場合は Y です。
323
+ gem: '`donation_code_valid?`, `mobile_barcode_valid?`'
324
+ OrganName:
325
+ zh: 受捐贈單位名稱
326
+ en: Name of the charity a donation code belongs to.
327
+ ja: 寄付コードに対応する慈善団体の名称です。
328
+ gem: 'not surfaced; see `Testing.ecpay_invoice_request` to inspect'
329
+ PrintStyle:
330
+ zh: 列印格式
331
+ en: Layout of the printable invoice page. 1 is the standard layout.
332
+ ja: 発票の印刷用ページのレイアウトです。1 は標準レイアウトです。
333
+ gem: '`extra: {"PrintStyle" => ...}`'
334
+ IsShowingDetail:
335
+ zh: 是否列印明細
336
+ en: Whether the printable page lists the items.
337
+ ja: 印刷用ページに品目を表示するかどうかです。
338
+ gem: '`extra: {"IsShowingDetail" => ...}`'
339
+ InvoiceHtml:
340
+ zh: 發票列印網址
341
+ en: Link to ECPay's printable page for the invoice. It expires.
342
+ ja: ECPay が用意する発票の印刷用ページへのリンクです。有効期限があります。
343
+ gem: '`print_url`'
344
+ IIS_Mer_ID:
345
+ zh: 特店編號
346
+ en: Merchant ID.
347
+ ja: 加盟店 ID です。
348
+ gem: '`raw["IIS_Mer_ID"]`'
349
+ IIS_Number:
350
+ zh: 發票號碼
351
+ en: Invoice number.
352
+ ja: 発票番号です。
353
+ gem: '`invoice_no`'
354
+ IIS_Relate_Number:
355
+ zh: 特店自訂編號
356
+ en: Your reference for the invoice.
357
+ ja: 加盟店側で発票に付けた参照番号です。
358
+ gem: '`order_no`'
359
+ IIS_Customer_ID:
360
+ zh: 客戶編號
361
+ en: Your own ID for the customer.
362
+ ja: 加盟店側で管理している顧客 ID です。
363
+ gem: '`buyer.customer_id`'
364
+ IIS_Identifier:
365
+ zh: 買方統編
366
+ en: Buyer's tax ID. Ten zeros on a consumer invoice.
367
+ ja: 購入者の統一編号です。消費者向けの発票では 0 が 10 桁並んだ値になります。
368
+ gem: '`buyer.tax_id`'
369
+ IIS_Customer_Name:
370
+ zh: 客戶名稱
371
+ en: Buyer's name.
372
+ ja: 購入者の名前です。
373
+ gem: '`buyer.name`'
374
+ IIS_Customer_Addr:
375
+ zh: 客戶地址
376
+ en: Buyer's address.
377
+ ja: 購入者の住所です。
378
+ gem: '`buyer.address`'
379
+ IIS_Customer_Phone:
380
+ zh: 客戶電話
381
+ en: Buyer's mobile number.
382
+ ja: 購入者の携帯電話番号です。
383
+ gem: '`buyer.phone`'
384
+ IIS_Customer_Email:
385
+ zh: 客戶信箱
386
+ en: Buyer's email.
387
+ ja: 購入者のメールアドレスです。
388
+ gem: '`buyer.email`'
389
+ IIS_Clearance_Mark:
390
+ zh: 通關方式
391
+ en: Customs mark for zero-rated sales.
392
+ ja: ゼロ税率の販売における通関区分です。
393
+ gem: '`raw["IIS_Clearance_Mark"]`'
394
+ IIS_Type:
395
+ zh: 發票種類
396
+ en: 07 general tax, 08 special tax.
397
+ ja: 07 は一般税額、08 は特種税額です。
398
+ gem: '`raw["IIS_Type"]`'
399
+ IIS_Category:
400
+ zh: 發票類別
401
+ en: B2C or B2B.
402
+ ja: B2C または B2B です。
403
+ gem: '`raw["IIS_Category"]`'
404
+ IIS_Tax_Type:
405
+ zh: 課稅別
406
+ en: 1 taxable, 2 zero-rated, 3 exempt, 9 mixed.
407
+ ja: 1 は課税、2 はゼロ税率、3 は免税、9 は混合です。
408
+ gem: '`raw["IIS_Tax_Type"]`'
409
+ IIS_Tax_Rate:
410
+ zh: 稅率
411
+ en: Tax rate, 0.05 for the standard 5%.
412
+ ja: 税率です。標準の 5% の場合は 0.05 です。
413
+ gem: '`raw["IIS_Tax_Rate"]`'
414
+ IIS_Tax_Amount:
415
+ zh: 稅金
416
+ en: Tax portion of the total. ECPay reports 0 on consumer invoices, where tax is not shown separately.
417
+ ja: 合計金額のうちの税額です。税額を別記しない消費者向けの発票では、ECPay は 0 を返します。
418
+ gem: '`tax_amount`'
419
+ IIS_Sales_Amount:
420
+ zh: 發票金額
421
+ en: Invoice total.
422
+ ja: 発票の合計金額です。
423
+ gem: '`total`'
424
+ IIS_Check_Number:
425
+ zh: 檢查碼
426
+ en: ECPay's internal check character.
427
+ ja: ECPay 内部のチェック文字です。
428
+ gem: '`raw["IIS_Check_Number"]`'
429
+ IIS_Carrier_Type:
430
+ zh: 載具類別
431
+ en: Carrier type, as in CarrierType.
432
+ ja: キャリアの種類です。値は CarrierType と同じです。
433
+ gem: '`carrier_type`'
434
+ IIS_Carrier_Num:
435
+ zh: 載具編號
436
+ en: Carrier number. For the member carrier ECPay reports its own generated ID.
437
+ ja: キャリアの番号です。会員キャリアの場合は、ECPay が独自に生成した ID が返されます。
438
+ gem: '`carrier_number`'
439
+ IIS_Love_Code:
440
+ zh: 捐贈碼
441
+ en: Donation code, or 0 when the invoice was not donated.
442
+ ja: 寄付コードです。発票が寄付されていない場合は 0 です。
443
+ gem: '`donation_code`'
444
+ IIS_IP:
445
+ zh: 發票開立 IP
446
+ en: IP address the issuing request came from.
447
+ ja: 発行リクエストの送信元 IP アドレスです。
448
+ gem: '`raw["IIS_IP"]`'
449
+ IIS_Create_Date:
450
+ zh: 發票開立時間
451
+ en: When the invoice was issued.
452
+ ja: 発票の発行日時です。
453
+ gem: '`issued_at`'
454
+ IIS_Issue_Status:
455
+ zh: 發票開立狀態
456
+ en: 1 issued, 0 cancelled.
457
+ ja: 1 は発行済み、0 は取消済みです。
458
+ gem: '`raw["IIS_Issue_Status"]`'
459
+ IIS_Invalid_Status:
460
+ zh: 發票作廢狀態
461
+ en: 1 when the invoice has been voided.
462
+ ja: 発票が無効化されている場合は 1 です。
463
+ gem: '`voided?`'
464
+ IIS_Upload_Status:
465
+ zh: 發票上傳狀態
466
+ en: 1 once the invoice has been reported to the Ministry of Finance.
467
+ ja: 発票が財政部へ報告されると 1 になります。
468
+ gem: '`uploaded?`'
469
+ IIS_Upload_Date:
470
+ zh: 發票上傳時間
471
+ en: When it was reported to the Ministry of Finance.
472
+ ja: 財政部へ報告された日時です。
473
+ gem: '`raw["IIS_Upload_Date"]`'
474
+ IIS_Turnkey_Status:
475
+ zh: 發票上傳後接收狀態
476
+ en: Ministry of Finance receipt status. C accepted, E failed, G in progress.
477
+ ja: 財政部側の受信状況です。C は受理、E は失敗、G は処理中です。
478
+ gem: '`raw["IIS_Turnkey_Status"]`'
479
+ IIS_Remain_Allowance_Amt:
480
+ zh: 剩餘可折讓金額
481
+ en: What can still be credited against the invoice.
482
+ ja: その発票に対して、まだ折譲できる残りの金額です。
483
+ gem: '`remaining_allowance_amount`'
484
+ IIS_Print_Flag:
485
+ zh: 列印旗標
486
+ en: 1 when the invoice was issued for printing.
487
+ ja: 印刷用として発行された発票の場合は 1 です。
488
+ gem: '`printed?`'
489
+ IIS_Award_Flag:
490
+ zh: 中獎旗標
491
+ en: Receipt lottery result. Empty before the draw, 0 no prize, 1 prize, X not eligible (business invoice).
492
+ ja: 統一発票の宝くじの結果です。抽せん前は空、0 は当せんなし、1 は当せん、X は対象外(事業者向けの発票)です。
493
+ gem: '`raw["IIS_Award_Flag"]`'
494
+ IIS_Award_Type:
495
+ zh: 中獎種類
496
+ en: Which lottery prize was won. 0 for none.
497
+ ja: 当せんした賞の種類です。当せんなしの場合は 0 です。
498
+ gem: '`raw["IIS_Award_Type"]`'
499
+ IIS_Random_Number:
500
+ zh: 隨機碼
501
+ en: Four-digit code printed on the invoice.
502
+ ja: 発票に印字される 4 桁のコードです。
503
+ gem: '`random_number`'
504
+ QRCode_Left:
505
+ zh: 電子發票左側 QRCode 內容
506
+ en: Content of the left QR code on a printed invoice.
507
+ ja: 印刷した発票の左側の QR コードの内容です。
508
+ gem: '`raw["QRCode_Left"]`'
509
+ QRCode_Right:
510
+ zh: 電子發票右側 QRCode 內容
511
+ en: Content of the right QR code on a printed invoice.
512
+ ja: 印刷した発票の右側の QR コードの内容です。
513
+ gem: '`raw["QRCode_Right"]`'
514
+ PosBarCode:
515
+ zh: 電子發票條碼內容
516
+ en: Content of the barcode on a printed invoice.
517
+ ja: 印刷した発票のバーコードの内容です。
518
+ gem: '`raw["PosBarCode"]`'
519
+ ChannelPartner:
520
+ zh: 通路商編號
521
+ en: Sales channel partner code. Most shops never use it.
522
+ ja: 販売チャネルパートナーのコードです。ほとんどの店舗では使いません。
523
+ gem: '`raw["ChannelPartner"]`'