tpaga 0.4.2.2 → 0.4.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tpaga.rb +2 -0
- data/lib/tpaga/api/refund_api.rb +49 -0
- data/lib/tpaga/models/credit_card_refund.rb +37 -0
- data/lib/tpaga/swagger/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef867960bb07f3111083e37fb167d82ee2991d7b
|
4
|
+
data.tar.gz: 6611bc51f6ff5af18420becd4476ac0b217bebcd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f87f8383f62626c84d4f494f64a9b2a39044ec2e71d2abd8b71b134a40864d8c5caecbf7764e3298257e202538ae43836937a4917f6a648fa1487be71276d380
|
7
|
+
data.tar.gz: 5772923c50f6fb1bb113db0c57805cd07623f43b6ae9849b47635eb0d5f403c11c9bff47d8dabf7fb944ba39b636ee6038c19b6b7e4d8586d15e33120a9eb88d
|
data/lib/tpaga.rb
CHANGED
@@ -13,6 +13,7 @@ require 'tpaga/models/address'
|
|
13
13
|
require 'tpaga/models/customer'
|
14
14
|
require 'tpaga/models/credit_card'
|
15
15
|
require 'tpaga/models/credit_card_create'
|
16
|
+
require 'tpaga/models/credit_card_refund'
|
16
17
|
require 'tpaga/models/billing_address'
|
17
18
|
require 'tpaga/models/credit_card_charge'
|
18
19
|
require 'tpaga/models/davi_plata'
|
@@ -28,6 +29,7 @@ require 'tpaga/api/customer_api'
|
|
28
29
|
require 'tpaga/api/davi_plata_api'
|
29
30
|
require 'tpaga/api/charge_api'
|
30
31
|
require 'tpaga/api/credit_card_api'
|
32
|
+
require 'tpaga/api/refund_api'
|
31
33
|
|
32
34
|
module Tpaga
|
33
35
|
# Initialize the default configuration
|
@@ -0,0 +1,49 @@
|
|
1
|
+
|
2
|
+
module Tpaga
|
3
|
+
class RefundApi
|
4
|
+
|
5
|
+
basePath = "https://sandbox.tpaga.co/api"
|
6
|
+
|
7
|
+
# Try to refund a CreditCardCharge to a Customer's CreditCard
|
8
|
+
# Refunds a new `CreditCardCharge` that was successful to a `CreditCard`. It only can be done within the same day of the `CreditCardCharge`
|
9
|
+
# @param body - **id** It is the id of the `CreditCardCharge` thats going to be refunded.
|
10
|
+
# @param [Hash] opts the optional parameters
|
11
|
+
# @return [CreditCardCharge]
|
12
|
+
def self.refund_credit_card_charge(body, opts = {})
|
13
|
+
|
14
|
+
# verify the required parameter 'body' is set
|
15
|
+
fail "Missing the required parameter 'body' when calling refund_credit_card_charge" if body.nil?
|
16
|
+
|
17
|
+
# resource path
|
18
|
+
path = "/refund/credit_card".sub('{format}','json')
|
19
|
+
|
20
|
+
# query parameters
|
21
|
+
query_params = {}
|
22
|
+
|
23
|
+
# header parameters
|
24
|
+
header_params = {}
|
25
|
+
|
26
|
+
# HTTP header 'Accept' (if needed)
|
27
|
+
_header_accept = []
|
28
|
+
_header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
|
29
|
+
|
30
|
+
# HTTP header 'Content-Type'
|
31
|
+
_header_content_type = []
|
32
|
+
header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type)
|
33
|
+
|
34
|
+
# form parameters
|
35
|
+
form_params = {}
|
36
|
+
|
37
|
+
# http body (model)
|
38
|
+
post_body = Swagger::Request.object_to_http_body(body)
|
39
|
+
|
40
|
+
auth_names = ['api_key']
|
41
|
+
response = Swagger::Request.new(:POST, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body
|
42
|
+
obj = CreditCardCharge.new() and obj.build_from_hash(response)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Tpaga
|
2
|
+
#
|
3
|
+
class CreditCardRefund < BaseObject
|
4
|
+
attr_accessor :id
|
5
|
+
# attribute mapping from ruby-style variable name to JSON key
|
6
|
+
def self.attribute_map
|
7
|
+
{
|
8
|
+
|
9
|
+
# The id of the `CreditCardCharge` to be refunded.
|
10
|
+
:'id' => :'id'
|
11
|
+
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
15
|
+
# attribute type
|
16
|
+
def self.swagger_types
|
17
|
+
{
|
18
|
+
:'id' => :'string'
|
19
|
+
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize(attributes = {})
|
24
|
+
return if !attributes.is_a?(Hash) || attributes.empty?
|
25
|
+
|
26
|
+
# convert string to symbol for hash key
|
27
|
+
attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
28
|
+
|
29
|
+
|
30
|
+
if attributes[:'id']
|
31
|
+
self.id = attributes[:'id']
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tpaga
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Ortiz V.
|
@@ -88,6 +88,7 @@ files:
|
|
88
88
|
- lib/tpaga/api/credit_card_api.rb
|
89
89
|
- lib/tpaga/api/customer_api.rb
|
90
90
|
- lib/tpaga/api/davi_plata_api.rb
|
91
|
+
- lib/tpaga/api/refund_api.rb
|
91
92
|
- lib/tpaga/models/address.rb
|
92
93
|
- lib/tpaga/models/api_error.rb
|
93
94
|
- lib/tpaga/models/api_errors_item.rb
|
@@ -97,6 +98,7 @@ files:
|
|
97
98
|
- lib/tpaga/models/credit_card.rb
|
98
99
|
- lib/tpaga/models/credit_card_charge.rb
|
99
100
|
- lib/tpaga/models/credit_card_create.rb
|
101
|
+
- lib/tpaga/models/credit_card_refund.rb
|
100
102
|
- lib/tpaga/models/customer.rb
|
101
103
|
- lib/tpaga/models/davi_plata.rb
|
102
104
|
- lib/tpaga/models/davi_plata_charge.rb
|