webpay 3.2.0 → 3.2.1

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
  SHA1:
3
- metadata.gz: f3dbcdcba5bf87d216b11728ffecfc1b730cde60
4
- data.tar.gz: b3cb7981d1dab7149c1a8a4d8d6285e51ed793a3
3
+ metadata.gz: 78307f5c91271a987bbaa3b55a37e5c1772a07d3
4
+ data.tar.gz: 247c7932211d2aca377458331f7308a8eff46586
5
5
  SHA512:
6
- metadata.gz: b29a88e162e1389f75dabf0163525f37b8869317c350d79bf00b23a1f7f30568187813e1ac888712fa1ab0615a5261efcfc44b19d6d97fa8930a899a3b0f5db9
7
- data.tar.gz: 7f252649b327693f313b690e72672042fa4787910926cf76762119274d085dfb38ff9f8f0d25cbf0554c11e7677cbc9e5550a18c0fb360ffd6403c521f38bf6a
6
+ metadata.gz: d84730f96e52fef12aee659f3db2e86c3dfe30643779eb377d3d421305138f18c67965fc881a12f8ec8f1d19dad0bca976dc1747dbdbfb08c7225f65a5edb034
7
+ data.tar.gz: 95af13dfe005a73359470a7a6c06808baf32b6f290b74157c84863b409995fb91c5df9c736faf7a6f90717febfee39ddc15abee1803dad7cf8a30cac6315b076
@@ -30,7 +30,7 @@ class WebPay
30
30
 
31
31
  "Accept" => "application/json",
32
32
 
33
- "User-Agent" => "Apipa-webpay/3.2.0 ruby",
33
+ "User-Agent" => "Apipa-webpay/3.2.1 ruby",
34
34
 
35
35
  "Accept-Language" => "en",
36
36
  }
@@ -23,10 +23,10 @@ class WebPay::Charge < WebPay::ApiResource
23
23
  # Refund a paid charge specified by charge id.
24
24
  # Optional argument amount is to refund partially.
25
25
  #
26
- # @param params [ChargeRequestWithAmount|Hash] Parameters to API call
26
+ # @param params [ChargeRequestRefund|Hash] Parameters to API call
27
27
  # @return [ChargeResponse]
28
28
  def refund(params = {})
29
- req = WebPay::ChargeRequestWithAmount.create(params)
29
+ req = WebPay::ChargeRequestRefund.create(params)
30
30
  raw_response = @client._request(:post, 'charges' + '/' + req.id.to_s + '/' + 'refund', req)
31
31
  WebPay::ChargeResponse.new(raw_response)
32
32
  end
@@ -477,6 +477,71 @@ class WebPay
477
477
  attributes['id'] = value
478
478
  end
479
479
 
480
+ end
481
+ class ChargeRequestRefund < Entity
482
+ attr_reader :attributes
483
+
484
+ def self.fields
485
+ ['id', 'amount', 'uuid']
486
+ end
487
+
488
+
489
+ def self.create(params)
490
+ return params if params.is_a?(self)
491
+ hash = case params
492
+ when Hash; params
493
+ when WebPay::ChargeResponse; {'id' => params.id}
494
+ when String; {'id' => params}
495
+ else
496
+ raise WebPay::InvalidRequestError.new("#{self} does not accept the given value", params)
497
+ end
498
+ self.new(hash)
499
+ end
500
+
501
+ def initialize(hash = {})
502
+ hash = normalize_hash(hash)
503
+ @attributes = hash
504
+ end
505
+
506
+
507
+ def request_body
508
+ result = {}
509
+ copy_if_exists(@attributes, result, 'amount', 'request_body');
510
+ copy_if_exists(@attributes, result, 'uuid', 'request_body');
511
+ result
512
+ end
513
+
514
+ def query_params
515
+ result = {}
516
+ return result
517
+ end
518
+
519
+
520
+ # attributes accessors
521
+ def id
522
+ attributes['id']
523
+ end
524
+
525
+ def id=(value)
526
+ attributes['id'] = value
527
+ end
528
+
529
+ def amount
530
+ attributes['amount']
531
+ end
532
+
533
+ def amount=(value)
534
+ attributes['amount'] = value
535
+ end
536
+
537
+ def uuid
538
+ attributes['uuid']
539
+ end
540
+
541
+ def uuid=(value)
542
+ attributes['uuid'] = value
543
+ end
544
+
480
545
  end
481
546
  class ChargeRequestWithAmount < Entity
482
547
  attr_reader :attributes
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'webpay'
5
- spec.version = '3.2.0'
5
+ spec.version = '3.2.1'
6
6
  spec.authors = ['webpay', 'tomykaira']
7
7
  spec.email = ['administrators@webpay.jp', 'tomykaira@webpay.jp']
8
8
  spec.description = 'WebPay is payment gateway service in Japan. see also https://webpay.jp/'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpay
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - webpay