tappay_ruby 0.15.5 → 0.15.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 146be4d4ff4112ff017c266a893c176c9206a57c034189bfd530b6cad24bef86
4
- data.tar.gz: 5e25c3dd0c25be2a8ecdf9606c81ef60e5617bf202602d26a0cb418fb3c426b2
3
+ metadata.gz: a329206f8149dcee28160ef08fe91ff68105eb34a75a3d1c8472ed7f4cdc6a3e
4
+ data.tar.gz: 130d3c8f4733f126fc8ca6f548757583c0727a20b9c868a24d64bba1190202fb
5
5
  SHA512:
6
- metadata.gz: 72f03e4010ca3178a1dd5733790afa8984f0b1159a8fc6b9346ad97daee5d6d0f09af83f09a2e9865ba37f3ee881e6dc75afc0ddeb3f18c02afcdbcad98ec732
7
- data.tar.gz: '08eb7436250853c03f662eeb90adfc7f65cd8e119496430f121b4ebffe9e2b6398abfe94d6c14007db4b717dd8509ee6e9857a4ba88e942ff917d3477eb6a942'
6
+ metadata.gz: 6a4a743872849f9d5963bc9a617a594677c47423bff870522f5a6dff650572bfc21cc7464c3ad8a39f3856a24fb04ab9650e2d320771e753f5ddf3f0c70dc14f
7
+ data.tar.gz: 8abbe504384923079ac7d813e409314e746e0b21ae72cb50f008fee2b0c69ba269791654ed569e8584e24a8af5b0657e244bf3332b59a41cd1f51b2c91d6e470
data/README.md CHANGED
@@ -140,10 +140,15 @@ result = Tappay::LinePay::Pay.new(
140
140
  Process refunds for any payment method:
141
141
 
142
142
  ```ruby
143
- # Process a refund
143
+ # Process a full refund
144
+ result = Tappay::Refund.new(
145
+ rec_trade_id: 'TRANSACTION_ID'
146
+ ).execute
147
+
148
+ # Process a partial refund
144
149
  result = Tappay::Refund.new(
145
150
  rec_trade_id: 'TRANSACTION_ID',
146
- amount: 1000
151
+ amount: 1000 # Optional: specify amount for partial refund
147
152
  ).execute
148
153
  ```
149
154
 
data/lib/tappay/refund.rb CHANGED
@@ -12,15 +12,17 @@ module Tappay
12
12
  private
13
13
 
14
14
  def refund_data
15
- {
15
+ data = {
16
16
  partner_key: Tappay.configuration.partner_key,
17
- rec_trade_id: options[:rec_trade_id],
18
- amount: options[:amount]
17
+ rec_trade_id: options[:rec_trade_id]
19
18
  }
19
+
20
+ data[:amount] = options[:amount] if options[:amount]
21
+ data
20
22
  end
21
23
 
22
24
  def validate_options!
23
- required = [:rec_trade_id, :amount]
25
+ required = [:rec_trade_id]
24
26
  missing = required.select { |key| options[key].nil? }
25
27
  raise ValidationError, "Missing required options: #{missing.join(', ')}" if missing.any?
26
28
  end
@@ -30,6 +30,7 @@ module Tappay
30
30
 
31
31
  def request_params
32
32
  {
33
+ partner_key: Tappay.configuration.partner_key,
33
34
  records_per_page: @records_per_page,
34
35
  page: @page,
35
36
  filters: filters,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tappay
4
- VERSION = "0.15.5"
4
+ VERSION = "0.15.7"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tappay_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.5
4
+ version: 0.15.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zac
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-01-23 00:00:00.000000000 Z
10
+ date: 2025-01-25 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: httparty