pcp-server-ruby-sdk 1.3.1 → 1.5.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +1 -1
- data/api-definition.yaml +955 -916
- data/example-app/example.rb +84 -0
- data/lib/PCP-server-Ruby-SDK/models/complete_payment_method_specific_input.rb +13 -4
- data/lib/PCP-server-Ruby-SDK/models/complete_payment_product840_specific_input.rb +232 -0
- data/lib/PCP-server-Ruby-SDK/models/complete_payment_request.rb +10 -1
- data/lib/PCP-server-Ruby-SDK/models/complete_redirect_payment_method_specific_input.rb +198 -0
- data/lib/PCP-server-Ruby-SDK/models/customer_device.rb +24 -4
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output.rb +16 -6
- data/lib/PCP-server-Ruby-SDK/models/payment_type.rb +2 -1
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input.rb +14 -4
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output.rb +14 -4
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input.rb +19 -6
- data/lib/PCP-server-Ruby-SDK/version.rb +1 -1
- data/lib/PCP-server-Ruby-SDK.rb +2 -0
- data/package-lock.json +411 -256
- data/package.json +1 -1
- data/scripts.sh +1 -1
- data/spec/endpoints/payment_execution_api_client_spec.rb +10 -1
- metadata +10 -8
|
@@ -5,17 +5,25 @@ module PCPServerSDK
|
|
|
5
5
|
module Models
|
|
6
6
|
# Object containing information about the device of the end customer.
|
|
7
7
|
class CustomerDevice
|
|
8
|
+
# The accept-header of the customer client from the HTTP Headers.
|
|
9
|
+
attr_accessor :accept_header
|
|
10
|
+
|
|
8
11
|
# The IP address of the customer client from the HTTP Headers.
|
|
9
12
|
attr_accessor :ip_address
|
|
10
13
|
|
|
11
14
|
# Tokenized representation of the end customers device. For example used for PAYONE Buy Now, Pay Later (BNPL).
|
|
12
15
|
attr_accessor :device_token
|
|
13
16
|
|
|
17
|
+
# User-Agent of the client device/browser from the HTTP Headers.
|
|
18
|
+
attr_accessor :user_agent
|
|
19
|
+
|
|
14
20
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
15
21
|
def self.attribute_map
|
|
16
22
|
{
|
|
23
|
+
:'accept_header' => :'acceptHeader',
|
|
17
24
|
:'ip_address' => :'ipAddress',
|
|
18
|
-
:'device_token' => :'deviceToken'
|
|
25
|
+
:'device_token' => :'deviceToken',
|
|
26
|
+
:'user_agent' => :'userAgent'
|
|
19
27
|
}
|
|
20
28
|
end
|
|
21
29
|
|
|
@@ -27,8 +35,10 @@ module PCPServerSDK
|
|
|
27
35
|
# Attribute type mapping.
|
|
28
36
|
def self.openapi_types
|
|
29
37
|
{
|
|
38
|
+
:'accept_header' => :'String',
|
|
30
39
|
:'ip_address' => :'String',
|
|
31
|
-
:'device_token' => :'String'
|
|
40
|
+
:'device_token' => :'String',
|
|
41
|
+
:'user_agent' => :'String'
|
|
32
42
|
}
|
|
33
43
|
end
|
|
34
44
|
|
|
@@ -53,6 +63,10 @@ module PCPServerSDK
|
|
|
53
63
|
h[k.to_sym] = v
|
|
54
64
|
}
|
|
55
65
|
|
|
66
|
+
if attributes.key?(:'accept_header')
|
|
67
|
+
self.accept_header = attributes[:'accept_header']
|
|
68
|
+
end
|
|
69
|
+
|
|
56
70
|
if attributes.key?(:'ip_address')
|
|
57
71
|
self.ip_address = attributes[:'ip_address']
|
|
58
72
|
end
|
|
@@ -60,6 +74,10 @@ module PCPServerSDK
|
|
|
60
74
|
if attributes.key?(:'device_token')
|
|
61
75
|
self.device_token = attributes[:'device_token']
|
|
62
76
|
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'user_agent')
|
|
79
|
+
self.user_agent = attributes[:'user_agent']
|
|
80
|
+
end
|
|
63
81
|
end
|
|
64
82
|
|
|
65
83
|
# Checks equality by comparing each attribute.
|
|
@@ -67,8 +85,10 @@ module PCPServerSDK
|
|
|
67
85
|
def ==(o)
|
|
68
86
|
return true if self.equal?(o)
|
|
69
87
|
self.class == o.class &&
|
|
88
|
+
accept_header == o.accept_header &&
|
|
70
89
|
ip_address == o.ip_address &&
|
|
71
|
-
|
|
90
|
+
device_token == o.device_token &&
|
|
91
|
+
user_agent == o.user_agent
|
|
72
92
|
end
|
|
73
93
|
|
|
74
94
|
# @see the `==` method
|
|
@@ -80,7 +100,7 @@ module PCPServerSDK
|
|
|
80
100
|
# Calculates hash code according to all attributes.
|
|
81
101
|
# @return [Integer] Hash code
|
|
82
102
|
def hash
|
|
83
|
-
[ip_address, device_token].hash
|
|
103
|
+
[accept_header, ip_address, device_token, user_agent].hash
|
|
84
104
|
end
|
|
85
105
|
|
|
86
106
|
# Builds the object from hash
|
|
@@ -12,12 +12,16 @@ module PCPServerSDK
|
|
|
12
12
|
|
|
13
13
|
attr_accessor :shipping_address
|
|
14
14
|
|
|
15
|
+
# PayPal transaction ID
|
|
16
|
+
attr_accessor :pay_pal_transaction_id
|
|
17
|
+
|
|
15
18
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
16
19
|
def self.attribute_map
|
|
17
20
|
{
|
|
18
21
|
:'billing_address' => :'billingAddress',
|
|
19
22
|
:'customer_account' => :'customerAccount',
|
|
20
|
-
:'shipping_address' => :'shippingAddress'
|
|
23
|
+
:'shipping_address' => :'shippingAddress',
|
|
24
|
+
:'pay_pal_transaction_id' => :'payPalTransactionId'
|
|
21
25
|
}
|
|
22
26
|
end
|
|
23
27
|
|
|
@@ -31,7 +35,8 @@ module PCPServerSDK
|
|
|
31
35
|
{
|
|
32
36
|
:'billing_address' => :'Address',
|
|
33
37
|
:'customer_account' => :'PaymentProduct840CustomerAccount',
|
|
34
|
-
:'shipping_address' => :'Address'
|
|
38
|
+
:'shipping_address' => :'Address',
|
|
39
|
+
:'pay_pal_transaction_id' => :'String'
|
|
35
40
|
}
|
|
36
41
|
end
|
|
37
42
|
|
|
@@ -67,6 +72,10 @@ module PCPServerSDK
|
|
|
67
72
|
if attributes.key?(:'shipping_address')
|
|
68
73
|
self.shipping_address = attributes[:'shipping_address']
|
|
69
74
|
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'pay_pal_transaction_id')
|
|
77
|
+
self.pay_pal_transaction_id = attributes[:'pay_pal_transaction_id']
|
|
78
|
+
end
|
|
70
79
|
end
|
|
71
80
|
|
|
72
81
|
# Checks equality by comparing each attribute.
|
|
@@ -74,9 +83,10 @@ module PCPServerSDK
|
|
|
74
83
|
def ==(o)
|
|
75
84
|
return true if self.equal?(o)
|
|
76
85
|
self.class == o.class &&
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
billing_address == o.billing_address &&
|
|
87
|
+
customer_account == o.customer_account &&
|
|
88
|
+
shipping_address == o.shipping_address &&
|
|
89
|
+
pay_pal_transaction_id == o.pay_pal_transaction_id
|
|
80
90
|
end
|
|
81
91
|
|
|
82
92
|
# @see the `==` method
|
|
@@ -88,7 +98,7 @@ module PCPServerSDK
|
|
|
88
98
|
# Calculates hash code according to all attributes.
|
|
89
99
|
# @return [Integer] Hash code
|
|
90
100
|
def hash
|
|
91
|
-
[billing_address, customer_account, shipping_address].hash
|
|
101
|
+
[billing_address, customer_account, shipping_address, pay_pal_transaction_id].hash
|
|
92
102
|
end
|
|
93
103
|
|
|
94
104
|
# Builds the object from hash
|
|
@@ -10,12 +10,13 @@ module PCPServerSDK
|
|
|
10
10
|
CAPTURE = "CAPTURE".freeze
|
|
11
11
|
REFUND = "REFUND".freeze
|
|
12
12
|
REVERSAL = "REVERSAL".freeze
|
|
13
|
+
CHARGEBACK = "CHARGEBACK".freeze
|
|
13
14
|
CHARGEBACK_REVERSAL = "CHARGEBACK_REVERSAL".freeze
|
|
14
15
|
CREDIT_NOTE = "CREDIT_NOTE".freeze
|
|
15
16
|
DEBIT_NOTE = "DEBIT_NOTE".freeze
|
|
16
17
|
|
|
17
18
|
def self.all_vars
|
|
18
|
-
@all_vars ||= [SALE, RESERVATION, CAPTURE, REFUND, REVERSAL, CHARGEBACK_REVERSAL, CREDIT_NOTE, DEBIT_NOTE].freeze
|
|
19
|
+
@all_vars ||= [SALE, RESERVATION, CAPTURE, REFUND, REVERSAL, CHARGEBACK, CHARGEBACK_REVERSAL, CREDIT_NOTE, DEBIT_NOTE].freeze
|
|
19
20
|
end
|
|
20
21
|
|
|
21
22
|
# Builds the enum from string
|
|
@@ -25,6 +25,9 @@ module PCPServerSDK
|
|
|
25
25
|
|
|
26
26
|
attr_accessor :redirection_data
|
|
27
27
|
|
|
28
|
+
# Indicates whether the PayPal JavaScript SDK flow is used on the redirect level.
|
|
29
|
+
attr_accessor :java_script_sdk_flow
|
|
30
|
+
|
|
28
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
32
|
def self.attribute_map
|
|
30
33
|
{
|
|
@@ -34,7 +37,8 @@ module PCPServerSDK
|
|
|
34
37
|
:'tokenize' => :'tokenize',
|
|
35
38
|
:'payment_product_id' => :'paymentProductId',
|
|
36
39
|
:'payment_product840_specific_input' => :'paymentProduct840SpecificInput',
|
|
37
|
-
:'redirection_data' => :'redirectionData'
|
|
40
|
+
:'redirection_data' => :'redirectionData',
|
|
41
|
+
:'java_script_sdk_flow' => :'javaScriptSdkFlow'
|
|
38
42
|
}
|
|
39
43
|
end
|
|
40
44
|
|
|
@@ -52,7 +56,8 @@ module PCPServerSDK
|
|
|
52
56
|
:'tokenize' => :'Boolean',
|
|
53
57
|
:'payment_product_id' => :'Integer',
|
|
54
58
|
:'payment_product840_specific_input' => :'RedirectPaymentProduct840SpecificInput',
|
|
55
|
-
:'redirection_data' => :'RedirectionData'
|
|
59
|
+
:'redirection_data' => :'RedirectionData',
|
|
60
|
+
:'java_script_sdk_flow' => :'Boolean'
|
|
56
61
|
}
|
|
57
62
|
end
|
|
58
63
|
|
|
@@ -104,6 +109,10 @@ module PCPServerSDK
|
|
|
104
109
|
if attributes.key?(:'redirection_data')
|
|
105
110
|
self.redirection_data = attributes[:'redirection_data']
|
|
106
111
|
end
|
|
112
|
+
|
|
113
|
+
if attributes.key?(:'java_script_sdk_flow')
|
|
114
|
+
self.java_script_sdk_flow = attributes[:'java_script_sdk_flow']
|
|
115
|
+
end
|
|
107
116
|
end
|
|
108
117
|
|
|
109
118
|
# Checks equality by comparing each attribute.
|
|
@@ -117,7 +126,8 @@ module PCPServerSDK
|
|
|
117
126
|
tokenize == o.tokenize &&
|
|
118
127
|
payment_product_id == o.payment_product_id &&
|
|
119
128
|
payment_product840_specific_input == o.payment_product840_specific_input &&
|
|
120
|
-
redirection_data == o.redirection_data
|
|
129
|
+
redirection_data == o.redirection_data &&
|
|
130
|
+
java_script_sdk_flow == o.java_script_sdk_flow
|
|
121
131
|
end
|
|
122
132
|
|
|
123
133
|
# @see the `==` method
|
|
@@ -129,7 +139,7 @@ module PCPServerSDK
|
|
|
129
139
|
# Calculates hash code according to all attributes.
|
|
130
140
|
# @return [Integer] Hash code
|
|
131
141
|
def hash
|
|
132
|
-
[requires_approval, payment_processing_token, reporting_token, tokenize, payment_product_id, payment_product840_specific_input, redirection_data].hash
|
|
142
|
+
[requires_approval, payment_processing_token, reporting_token, tokenize, payment_product_id, payment_product840_specific_input, redirection_data, java_script_sdk_flow].hash
|
|
133
143
|
end
|
|
134
144
|
|
|
135
145
|
# Builds the object from hash
|
|
@@ -17,13 +17,17 @@ module PCPServerSDK
|
|
|
17
17
|
# Token to identify the card in the reporting.
|
|
18
18
|
attr_accessor :reporting_token
|
|
19
19
|
|
|
20
|
+
# Indicates whether the PayPal JavaScript SDK flow was used for the redirect payment.
|
|
21
|
+
attr_accessor :java_script_sdk_flow
|
|
22
|
+
|
|
20
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
24
|
def self.attribute_map
|
|
22
25
|
{
|
|
23
26
|
:'payment_product_id' => :'paymentProductId',
|
|
24
27
|
:'payment_product840_specific_output' => :'paymentProduct840SpecificOutput',
|
|
25
28
|
:'payment_processing_token' => :'paymentProcessingToken',
|
|
26
|
-
:'reporting_token' => :'reportingToken'
|
|
29
|
+
:'reporting_token' => :'reportingToken',
|
|
30
|
+
:'java_script_sdk_flow' => :'javaScriptSdkFlow'
|
|
27
31
|
}
|
|
28
32
|
end
|
|
29
33
|
|
|
@@ -38,7 +42,8 @@ module PCPServerSDK
|
|
|
38
42
|
:'payment_product_id' => :'Integer',
|
|
39
43
|
:'payment_product840_specific_output' => :'PaymentProduct840SpecificOutput',
|
|
40
44
|
:'payment_processing_token' => :'String',
|
|
41
|
-
:'reporting_token' => :'String'
|
|
45
|
+
:'reporting_token' => :'String',
|
|
46
|
+
:'java_script_sdk_flow' => :'Boolean'
|
|
42
47
|
}
|
|
43
48
|
end
|
|
44
49
|
|
|
@@ -78,6 +83,10 @@ module PCPServerSDK
|
|
|
78
83
|
if attributes.key?(:'reporting_token')
|
|
79
84
|
self.reporting_token = attributes[:'reporting_token']
|
|
80
85
|
end
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'java_script_sdk_flow')
|
|
88
|
+
self.java_script_sdk_flow = attributes[:'java_script_sdk_flow']
|
|
89
|
+
end
|
|
81
90
|
end
|
|
82
91
|
|
|
83
92
|
# Checks equality by comparing each attribute.
|
|
@@ -88,7 +97,8 @@ module PCPServerSDK
|
|
|
88
97
|
payment_product_id == o.payment_product_id &&
|
|
89
98
|
payment_product840_specific_output == o.payment_product840_specific_output &&
|
|
90
99
|
payment_processing_token == o.payment_processing_token &&
|
|
91
|
-
reporting_token == o.reporting_token
|
|
100
|
+
reporting_token == o.reporting_token &&
|
|
101
|
+
java_script_sdk_flow == o.java_script_sdk_flow
|
|
92
102
|
end
|
|
93
103
|
|
|
94
104
|
# @see the `==` method
|
|
@@ -100,7 +110,7 @@ module PCPServerSDK
|
|
|
100
110
|
# Calculates hash code according to all attributes.
|
|
101
111
|
# @return [Integer] Hash code
|
|
102
112
|
def hash
|
|
103
|
-
[payment_product_id, payment_product840_specific_output, payment_processing_token, reporting_token].hash
|
|
113
|
+
[payment_product_id, payment_product840_specific_output, payment_processing_token, reporting_token, java_script_sdk_flow].hash
|
|
104
114
|
end
|
|
105
115
|
|
|
106
116
|
# Builds the object from hash
|
|
@@ -9,14 +9,21 @@ module PCPServerSDK
|
|
|
9
9
|
# Indicates whether to use PayPal Express Checkout Shortcut. * true = When shortcut is enabled, the consumer can select a shipping address during PayPal checkout. * false = When shortcut is disabled, the consumer cannot change the shipping address. Default value is false. Please note that this field is ignored when order.additionalInput.typeInformation.purchaseType is set to \"digital\"
|
|
10
10
|
attr_accessor :address_selection_at_pay_pal
|
|
11
11
|
|
|
12
|
-
# A unique ID determined by the merchant, to link a Paypal transaction to a FraudNet PayPal risk session. Only applicable to customer-initiated transactions, when the FraudNet SDK is used, and to be passed in the API request the same tracking ID value (FraudNet Session Identifier).
|
|
12
|
+
# A unique ID determined by the merchant, to link a Paypal transaction to a FraudNet PayPal risk session. Only applicable to customer-initiated transactions, when the FraudNet SDK is used, and to be passed in the API request the same tracking ID value (FraudNet Session Identifier). This SDK is available here https://developer.paypal.com/docs/checkout/apm/pay-upon-invoice/fraudnet/
|
|
13
13
|
attr_accessor :fraud_net_id
|
|
14
14
|
|
|
15
|
+
# Required parameter which defines how PayPal is being integrated inside the checkout page.
|
|
16
|
+
# * true = the current integration uses PayPal SDK
|
|
17
|
+
# * false = classic usage with PayPal Redirect flow
|
|
18
|
+
# @return [Boolean]
|
|
19
|
+
attr_accessor :java_script_sdk_flow
|
|
20
|
+
|
|
15
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
16
22
|
def self.attribute_map
|
|
17
23
|
{
|
|
18
24
|
:'address_selection_at_pay_pal' => :'addressSelectionAtPayPal',
|
|
19
|
-
:'fraud_net_id' => :'fraudNetId'
|
|
25
|
+
:'fraud_net_id' => :'fraudNetId',
|
|
26
|
+
:'java_script_sdk_flow' => :'javaScriptSdkFlow'
|
|
20
27
|
}
|
|
21
28
|
end
|
|
22
29
|
|
|
@@ -29,7 +36,8 @@ module PCPServerSDK
|
|
|
29
36
|
def self.openapi_types
|
|
30
37
|
{
|
|
31
38
|
:'address_selection_at_pay_pal' => :'Boolean',
|
|
32
|
-
:'fraud_net_id' => :'String'
|
|
39
|
+
:'fraud_net_id' => :'String',
|
|
40
|
+
:'java_script_sdk_flow' => :'Boolean'
|
|
33
41
|
}
|
|
34
42
|
end
|
|
35
43
|
|
|
@@ -61,6 +69,10 @@ module PCPServerSDK
|
|
|
61
69
|
if attributes.key?(:'fraud_net_id')
|
|
62
70
|
self.fraud_net_id = attributes[:'fraud_net_id']
|
|
63
71
|
end
|
|
72
|
+
|
|
73
|
+
if attributes.key?(:'java_script_sdk_flow')
|
|
74
|
+
self.java_script_sdk_flow = attributes[:'java_script_sdk_flow']
|
|
75
|
+
end
|
|
64
76
|
end
|
|
65
77
|
|
|
66
78
|
# Checks equality by comparing each attribute.
|
|
@@ -68,8 +80,9 @@ module PCPServerSDK
|
|
|
68
80
|
def ==(o)
|
|
69
81
|
return true if self.equal?(o)
|
|
70
82
|
self.class == o.class &&
|
|
71
|
-
|
|
72
|
-
|
|
83
|
+
address_selection_at_pay_pal == o.address_selection_at_pay_pal &&
|
|
84
|
+
fraud_net_id == o.fraud_net_id &&
|
|
85
|
+
java_script_sdk_flow == o.java_script_sdk_flow
|
|
73
86
|
end
|
|
74
87
|
|
|
75
88
|
# @see the `==` method
|
|
@@ -81,7 +94,7 @@ module PCPServerSDK
|
|
|
81
94
|
# Calculates hash code according to all attributes.
|
|
82
95
|
# @return [Integer] Hash code
|
|
83
96
|
def hash
|
|
84
|
-
[address_selection_at_pay_pal, fraud_net_id].hash
|
|
97
|
+
[address_selection_at_pay_pal, fraud_net_id, java_script_sdk_flow].hash
|
|
85
98
|
end
|
|
86
99
|
|
|
87
100
|
# Builds the object from hash
|
data/lib/PCP-server-Ruby-SDK.rb
CHANGED
|
@@ -127,6 +127,8 @@ require_relative 'PCP-server-Ruby-SDK/models/processing_mandate_information'
|
|
|
127
127
|
require_relative 'PCP-server-Ruby-SDK/models/product_type'
|
|
128
128
|
require_relative 'PCP-server-Ruby-SDK/models/redirect_data'
|
|
129
129
|
require_relative 'PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input'
|
|
130
|
+
require_relative 'PCP-server-Ruby-SDK/models/complete_payment_product840_specific_input'
|
|
131
|
+
require_relative 'PCP-server-Ruby-SDK/models/complete_redirect_payment_method_specific_input'
|
|
130
132
|
require_relative 'PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output'
|
|
131
133
|
require_relative 'PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input'
|
|
132
134
|
require_relative 'PCP-server-Ruby-SDK/models/redirection_data'
|