toss_payments 0.3.5 → 0.3.8

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 (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/toss_payments.rb +11 -6
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad6aa1f3febf18709c37946069a4c698a54dc5f08a6942d52a942afbdd674a45
4
- data.tar.gz: 401931a9b036365e3bfe5a49166a6365b1d62ea3f338be6d7d1de6e64b2e6786
3
+ metadata.gz: 13a84ad33130755ba6072a7fe8963ef8cf63c659bc43758233502c9cc60ee130
4
+ data.tar.gz: 2a2cee78d7fd79dec98e041a0f40056ad4cffe1a4cb5449e0effc8c4695effe9
5
5
  SHA512:
6
- metadata.gz: 3fd5e8d37a1d4e5dd8179bb66c25e098a5f97249a9670daf77ae103a528295df35e85da435c9f5c8293840f533ae5d81dc8017ac79d2111b84d78950d1cdede6
7
- data.tar.gz: 3ff0606194d468223484d2c3e1cf06c373419964465b8566dbe29bd7e390537be3d73c522b070d257970a83d1b6fd7e4e1221f3aa34ee178bce6574fe73a8efa
6
+ metadata.gz: f32f01fcfab996402eb685cc7fc91a8b8b7b7c4933b82404e97b1377e1d791e8e7f22b11a2a6a87c0989b561884eba17116dcd7da7c30512b98154ac715d55d9
7
+ data.tar.gz: c407034e46648c891ff53977b010cc3e38bae35a02a37363a9bd5fb3cd157934e9f1ed99e539237dfce0f8a2b4373812ae54e71cbae1ea22eb1e15d1f6fcf59c
data/lib/toss_payments.rb CHANGED
@@ -24,7 +24,7 @@ module TossPayments
24
24
  :balanced_amount,
25
25
  :status,
26
26
  :requested_at,
27
- :approved_at,
27
+ :approved_at, # nullable
28
28
  :use_escrow,
29
29
  :last_transaction_key,
30
30
  :supplied_amount,
@@ -172,9 +172,9 @@ module TossPayments
172
172
  method: response["method"],
173
173
  total_amount: response["totalAmount"],
174
174
  balanced_amount: response["balancedAmount"],
175
- status: response["status"]&.downcase.to_sym,
175
+ status: response["status"]&.downcase&.to_sym,
176
176
  requested_at: Time.parse(response["requestedAt"]),
177
- approved_at: Time.parse(response["approvedAt"]),
177
+ approved_at: response["approvedAt"] ? Time.parse(response["approvedAt"]) : nil,
178
178
  use_escrow: response["useEscrow"],
179
179
  last_transaction_key: response["lastTransactionKey"],
180
180
  supplied_amount: response["suppliedAmount"],
@@ -205,9 +205,9 @@ module TossPayments
205
205
  use_card_point: response["card"]["useCardPoint"],
206
206
  card_type: response["card"]["cardType"],
207
207
  owner_type: response["card"]["ownerType"],
208
- acquire_status: response["card"]["acquireStatus"]&.downcase.to_sym,
208
+ acquire_status: response["card"]["acquireStatus"]&.downcase&.to_sym,
209
209
  is_interest_free: response["card"]["isInterestFree"],
210
- interest_payer: response["card"]["interestPayer"]&.downcase.to_sym,
210
+ interest_payer: response["card"]["interestPayer"]&.downcase&.to_sym,
211
211
  } : nil,
212
212
  virtual_account: response["virtualAccount"] ? {
213
213
  account_type: response["virtualAccount"]["accountType"],
@@ -215,9 +215,14 @@ module TossPayments
215
215
  bank_code: response["virtualAccount"]["bankCode"],
216
216
  customer_name: response["virtualAccount"]["customerName"],
217
217
  due_date: Time.parse(response["virtualAccount"]["dueDate"]),
218
- refund_status: response["virtualAccount"]["refundStatus"]&.downcase.to_sym,
218
+ refund_status: response["virtualAccount"]["refundStatus"]&.downcase&.to_sym,
219
219
  expired: response["virtualAccount"]["expired"],
220
220
  settlement_status: response["virtualAccount"]["settlementStatus"],
221
+ refund_receive_account: response["virtualAccount"]["refundReceiveAccount"] ? {
222
+ bank_code: response["virtualAccount"]["refundReceiveAccount"]["bankCode"],
223
+ account_number: response["virtualAccount"]["refundReceiveAccount"]["accountNumber"],
224
+ holder_name: response["virtualAccount"]["refundReceiveAccount"]["holderName"],
225
+ } : nil,
221
226
  } : nil,
222
227
  secret: response["secret"],
223
228
  mobile_phone: response["mobilePhone"] ? {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toss_payments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soohyeon Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-13 00:00:00.000000000 Z
11
+ date: 2023-03-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: toss payments api
14
14
  email: lsh59727@gmail.com