pcp-server-ruby-sdk 1.12.0 → 1.14.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 +14 -0
- data/README.md +1 -1
- data/api-definition.yaml +693 -40
- data/lib/PCP-server-Ruby-SDK/endpoints/pay_by_link_api_client.rb +33 -0
- data/lib/PCP-server-Ruby-SDK/endpoints/payment_intent_api_client.rb +37 -0
- data/lib/PCP-server-Ruby-SDK/models/address.rb +9 -237
- data/lib/PCP-server-Ruby-SDK/models/address_personal.rb +10 -246
- data/lib/PCP-server-Ruby-SDK/models/amount_of_money.rb +4 -195
- data/lib/PCP-server-Ruby-SDK/models/api_error.rb +27 -232
- data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_header_information.rb +6 -194
- data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_information.rb +8 -229
- data/lib/PCP-server-Ruby-SDK/models/authentication_token.rb +6 -183
- data/lib/PCP-server-Ruby-SDK/models/bank_account_information.rb +11 -207
- data/lib/PCP-server-Ruby-SDK/models/bank_payout_method_specific_input.rb +4 -187
- data/lib/PCP-server-Ruby-SDK/models/cancel_item.rb +6 -195
- data/lib/PCP-server-Ruby-SDK/models/cancel_payment_request.rb +6 -222
- data/lib/PCP-server-Ruby-SDK/models/cancel_payment_response.rb +4 -190
- data/lib/PCP-server-Ruby-SDK/models/cancel_request.rb +6 -224
- data/lib/PCP-server-Ruby-SDK/models/cancel_response.rb +4 -190
- data/lib/PCP-server-Ruby-SDK/models/capture_output.rb +9 -214
- data/lib/PCP-server-Ruby-SDK/models/capture_payment_request.rb +14 -253
- data/lib/PCP-server-Ruby-SDK/models/capture_payment_response.rb +7 -239
- data/lib/PCP-server-Ruby-SDK/models/card_fraud_results.rb +29 -184
- data/lib/PCP-server-Ruby-SDK/models/card_info.rb +3 -182
- data/lib/PCP-server-Ruby-SDK/models/card_payment_details.rb +8 -210
- data/lib/PCP-server-Ruby-SDK/models/card_payment_method_specific_input.rb +32 -307
- data/lib/PCP-server-Ruby-SDK/models/card_payment_method_specific_output.rb +6 -210
- data/lib/PCP-server-Ruby-SDK/models/card_recurrence_details.rb +12 -186
- data/lib/PCP-server-Ruby-SDK/models/cart_item_data.rb +10 -0
- data/lib/PCP-server-Ruby-SDK/models/cart_item_input.rb +5 -198
- data/lib/PCP-server-Ruby-SDK/models/cart_item_invoice_data.rb +5 -184
- data/lib/PCP-server-Ruby-SDK/models/cart_item_order_status.rb +4 -213
- data/lib/PCP-server-Ruby-SDK/models/cart_item_patch.rb +5 -200
- data/lib/PCP-server-Ruby-SDK/models/cart_item_result.rb +5 -200
- data/lib/PCP-server-Ruby-SDK/models/cart_item_supplier_references.rb +6 -195
- data/lib/PCP-server-Ruby-SDK/models/checkout_references.rb +4 -192
- data/lib/PCP-server-Ruby-SDK/models/checkout_response.rb +15 -319
- data/lib/PCP-server-Ruby-SDK/models/checkouts_response.rb +4 -193
- data/lib/PCP-server-Ruby-SDK/models/company_information.rb +3 -182
- data/lib/PCP-server-Ruby-SDK/models/complete_financing_payment_method_specific_input.rb +12 -202
- data/lib/PCP-server-Ruby-SDK/models/complete_order_request.rb +3 -181
- data/lib/PCP-server-Ruby-SDK/models/complete_payment_method_specific_input.rb +4 -191
- data/lib/PCP-server-Ruby-SDK/models/complete_payment_product840_specific_input.rb +7 -226
- data/lib/PCP-server-Ruby-SDK/models/complete_payment_request.rb +6 -209
- data/lib/PCP-server-Ruby-SDK/models/complete_payment_response.rb +5 -199
- data/lib/PCP-server-Ruby-SDK/models/complete_redirect_payment_method_specific_input.rb +4 -192
- data/lib/PCP-server-Ruby-SDK/models/contact_details.rb +4 -191
- data/lib/PCP-server-Ruby-SDK/models/create_checkout_request.rb +13 -240
- data/lib/PCP-server-Ruby-SDK/models/create_checkout_response.rb +16 -307
- data/lib/PCP-server-Ruby-SDK/models/create_commerce_case_response.rb +7 -219
- data/lib/PCP-server-Ruby-SDK/models/create_pay_by_link_request.rb +12 -0
- data/lib/PCP-server-Ruby-SDK/models/create_pay_by_link_response.rb +13 -0
- data/lib/PCP-server-Ruby-SDK/models/create_payment_intent.rb +11 -0
- data/lib/PCP-server-Ruby-SDK/models/create_payment_intent_request.rb +13 -0
- data/lib/PCP-server-Ruby-SDK/models/create_payment_intent_response.rb +10 -0
- data/lib/PCP-server-Ruby-SDK/models/create_payment_response.rb +7 -218
- data/lib/PCP-server-Ruby-SDK/models/customer.rb +28 -260
- data/lib/PCP-server-Ruby-SDK/models/customer_account.rb +10 -44
- data/lib/PCP-server-Ruby-SDK/models/customer_device.rb +8 -209
- data/lib/PCP-server-Ruby-SDK/models/deliver_item.rb +6 -195
- data/lib/PCP-server-Ruby-SDK/models/deliver_request.rb +10 -246
- data/lib/PCP-server-Ruby-SDK/models/deliver_response.rb +4 -191
- data/lib/PCP-server-Ruby-SDK/models/delivery_information.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/error_response.rb +4 -193
- data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_input.rb +15 -203
- data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_output.rb +10 -196
- data/lib/PCP-server-Ruby-SDK/models/fund_distribution.rb +12 -263
- data/lib/PCP-server-Ruby-SDK/models/fund_split.rb +5 -205
- data/lib/PCP-server-Ruby-SDK/models/fund_split_request.rb +3 -147
- data/lib/PCP-server-Ruby-SDK/models/fund_split_response.rb +10 -174
- data/lib/PCP-server-Ruby-SDK/models/installment_option.rb +13 -273
- data/lib/PCP-server-Ruby-SDK/models/link_information.rb +4 -196
- data/lib/PCP-server-Ruby-SDK/models/merchant_action.rb +16 -194
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_input.rb +13 -246
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_output.rb +7 -219
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_three_dsecure.rb +3 -179
- data/lib/PCP-server-Ruby-SDK/models/model_base.rb +147 -0
- data/lib/PCP-server-Ruby-SDK/models/order.rb +7 -221
- data/lib/PCP-server-Ruby-SDK/models/order_item.rb +6 -197
- data/lib/PCP-server-Ruby-SDK/models/order_line_details_input.rb +29 -305
- data/lib/PCP-server-Ruby-SDK/models/order_line_details_patch.rb +5 -326
- data/lib/PCP-server-Ruby-SDK/models/order_line_details_result.rb +5 -326
- data/lib/PCP-server-Ruby-SDK/models/order_request.rb +7 -244
- data/lib/PCP-server-Ruby-SDK/models/order_response.rb +4 -192
- data/lib/PCP-server-Ruby-SDK/models/patch_checkout_request.rb +8 -228
- data/lib/PCP-server-Ruby-SDK/models/patch_commerce_case_request.rb +3 -183
- data/lib/PCP-server-Ruby-SDK/models/pause_payment_request.rb +2 -165
- data/lib/PCP-server-Ruby-SDK/models/pause_payment_response.rb +3 -186
- data/lib/PCP-server-Ruby-SDK/models/pay_link_status_value.rb +20 -0
- data/lib/PCP-server-Ruby-SDK/models/payee.rb +6 -204
- data/lib/PCP-server-Ruby-SDK/models/payment_creation_output.rb +3 -183
- data/lib/PCP-server-Ruby-SDK/models/payment_event.rb +19 -274
- data/lib/PCP-server-Ruby-SDK/models/payment_execution.rb +29 -335
- data/lib/PCP-server-Ruby-SDK/models/payment_execution_request.rb +4 -191
- data/lib/PCP-server-Ruby-SDK/models/payment_execution_specific_input.rb +6 -212
- data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_request.rb +7 -205
- data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_response.rb +5 -196
- data/lib/PCP-server-Ruby-SDK/models/payment_information_request.rb +10 -249
- data/lib/PCP-server-Ruby-SDK/models/payment_information_response.rb +34 -314
- data/lib/PCP-server-Ruby-SDK/models/payment_instructions.rb +8 -214
- data/lib/PCP-server-Ruby-SDK/models/payment_intent_output.rb +13 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_intent_response.rb +13 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_intent_response_data.rb +12 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_link_order.rb +10 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_link_specific_input.rb +19 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_method_specific_input.rb +9 -261
- data/lib/PCP-server-Ruby-SDK/models/payment_method_specific_input_for_intent.rb +9 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_output.rb +11 -255
- data/lib/PCP-server-Ruby-SDK/models/payment_product302_specific_input.rb +11 -225
- data/lib/PCP-server-Ruby-SDK/models/payment_product3391_specific_input.rb +6 -197
- data/lib/PCP-server-Ruby-SDK/models/payment_product3391_specific_output.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/payment_product3392_specific_input.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/payment_product5002_specific_input.rb +7 -203
- data/lib/PCP-server-Ruby-SDK/models/payment_product771_specific_output.rb +3 -183
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_customer_account.rb +6 -210
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_customer_account_for_intent.rb +12 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output.rb +6 -211
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output_for_intent.rb +12 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_references.rb +6 -184
- data/lib/PCP-server-Ruby-SDK/models/payment_references_for_payment_intent.rb +11 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_references_for_refund.rb +12 -197
- data/lib/PCP-server-Ruby-SDK/models/payment_response.rb +6 -234
- data/lib/PCP-server-Ruby-SDK/models/payment_status_output.rb +6 -234
- data/lib/PCP-server-Ruby-SDK/models/payout_output.rb +5 -205
- data/lib/PCP-server-Ruby-SDK/models/payout_response.rb +6 -215
- data/lib/PCP-server-Ruby-SDK/models/personal_information.rb +11 -227
- data/lib/PCP-server-Ruby-SDK/models/personal_name.rb +5 -201
- data/lib/PCP-server-Ruby-SDK/models/positive_amount_of_money.rb +4 -196
- data/lib/PCP-server-Ruby-SDK/models/processing_mandate_information.rb +9 -254
- data/lib/PCP-server-Ruby-SDK/models/redirect_data.rb +3 -183
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input.rb +14 -249
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input_for_intent.rb +12 -0
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output.rb +6 -211
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output_for_create_intent.rb +12 -0
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output_for_intent.rb +10 -0
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input.rb +6 -205
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input_data.rb +10 -0
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product900_specific_input.rb +12 -177
- data/lib/PCP-server-Ruby-SDK/models/redirection_data.rb +11 -186
- data/lib/PCP-server-Ruby-SDK/models/references.rb +47 -205
- data/lib/PCP-server-Ruby-SDK/models/refresh_payment_request.rb +3 -186
- data/lib/PCP-server-Ruby-SDK/models/refund_error_response.rb +4 -193
- data/lib/PCP-server-Ruby-SDK/models/refund_output.rb +8 -211
- data/lib/PCP-server-Ruby-SDK/models/refund_payment_response.rb +7 -242
- data/lib/PCP-server-Ruby-SDK/models/refund_request.rb +6 -210
- data/lib/PCP-server-Ruby-SDK/models/return_information.rb +4 -194
- data/lib/PCP-server-Ruby-SDK/models/return_item.rb +6 -196
- data/lib/PCP-server-Ruby-SDK/models/return_request.rb +6 -234
- data/lib/PCP-server-Ruby-SDK/models/return_response.rb +4 -191
- data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_method_specific_input.rb +4 -193
- data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_method_specific_output.rb +4 -193
- data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_product771_specific_input.rb +4 -192
- data/lib/PCP-server-Ruby-SDK/models/sepa_transfer_payment_product_772_specific_input.rb +3 -186
- data/lib/PCP-server-Ruby-SDK/models/shipping.rb +3 -183
- data/lib/PCP-server-Ruby-SDK/models/shipping_address.rb +14 -0
- data/lib/PCP-server-Ruby-SDK/models/shopping_cart_data.rb +9 -0
- data/lib/PCP-server-Ruby-SDK/models/shopping_cart_input.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/shopping_cart_patch.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/shopping_cart_result.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/status_output.rb +21 -264
- data/lib/PCP-server-Ruby-SDK/models/three_d_secure_results.rb +6 -226
- data/lib/PCP-server-Ruby-SDK/queries/get_checkouts_query.rb +5 -1
- data/lib/PCP-server-Ruby-SDK/version.rb +1 -1
- data/lib/PCP-server-Ruby-SDK.rb +25 -0
- data/package-lock.json +2 -2
- data/package.json +1 -1
- data/scripts/convert_models_to_model_base.rb +128 -0
- data/spec/endpoints/pay_by_link_api_client_spec.rb +38 -0
- data/spec/endpoints/payment_information_api_client_spec.rb +9 -2
- data/spec/endpoints/payment_intent_api_client_spec.rb +45 -0
- data/spec/models/api_definition_conformance_spec.rb +88 -0
- data/spec/models/model_base_spec.rb +87 -0
- data/spec/models/pay_by_link_models_spec.rb +50 -0
- data/spec/models/payment_intent_models_spec.rb +51 -0
- data/spec/models/required_field_validation_spec.rb +5 -5
- data/spec/queries/get_checkouts_query_spec.rb +15 -0
- metadata +45 -10
- data/lib/PCP-server-Ruby-SDK/models/action_type.rb +0 -34
- data/lib/PCP-server-Ruby-SDK/models/avs_result.rb +0 -52
- data/lib/PCP-server-Ruby-SDK/models/business_relation.rb +0 -30
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'yaml'
|
|
3
|
+
require_relative '../../lib/PCP-server-Ruby-SDK'
|
|
4
|
+
|
|
5
|
+
RSpec.describe 'OpenAPI model conformance' do
|
|
6
|
+
let(:schemas) { YAML.unsafe_load_file(File.expand_path('../../api-definition.yaml', __dir__))['components']['schemas'] }
|
|
7
|
+
|
|
8
|
+
def schema_properties(name)
|
|
9
|
+
schema_properties_from(schemas.fetch(name))
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def schema_properties_from(schema)
|
|
13
|
+
inherited = Array(schema['allOf']).flat_map do |parent|
|
|
14
|
+
parent['$ref'] ? schema_properties(parent['$ref'].split('/').last) : schema_properties_from(parent)
|
|
15
|
+
end
|
|
16
|
+
inherited + schema.fetch('properties', {}).keys
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it 'provides a model for every object schema' do
|
|
20
|
+
object_schemas = schemas.select { |_name, schema| schema['type'] == 'object' }.keys
|
|
21
|
+
missing = object_schemas.reject { |name| PCPServerSDK::Models.const_defined?(name, false) }
|
|
22
|
+
|
|
23
|
+
expect(missing).to be_empty
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it 'uses ModelBase for every non-composed object schema' do
|
|
27
|
+
ineligible = schemas.select { |_name, schema| schema.key?('oneOf') || schema.key?('anyOf') }.keys
|
|
28
|
+
eligible = schemas.select { |name, schema| schema['type'] == 'object' && !ineligible.include?(name) }.keys
|
|
29
|
+
mismatches = eligible.reject { |name| PCPServerSDK::Models.const_get(name) <= PCPServerSDK::Models::ModelBase }
|
|
30
|
+
|
|
31
|
+
expect(mismatches).to be_empty
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it 'maps every flattened schema property' do
|
|
35
|
+
mismatches = schemas.filter_map do |name, schema|
|
|
36
|
+
next unless schema['type'] == 'object'
|
|
37
|
+
|
|
38
|
+
model = PCPServerSDK::Models.const_get(name)
|
|
39
|
+
expected = schema_properties(name).sort
|
|
40
|
+
actual = model.attribute_map.values.map(&:to_s).sort
|
|
41
|
+
"#{name}: expected #{expected}, got #{actual}" unless actual == expected
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
expect(mismatches).to be_empty
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
it 'declares each direct allOf parent' do
|
|
48
|
+
mismatches = schemas.filter_map do |name, schema|
|
|
49
|
+
expected = Array(schema['allOf']).filter_map { |parent| parent['$ref']&.split('/')&.last }.sort
|
|
50
|
+
next if expected.empty?
|
|
51
|
+
|
|
52
|
+
model = PCPServerSDK::Models.const_get(name)
|
|
53
|
+
actual = model.respond_to?(:openapi_all_of) ? model.openapi_all_of.map(&:to_s).sort : []
|
|
54
|
+
"#{name}: expected #{expected}, got #{actual}" unless actual == expected
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
expect(mismatches).to be_empty
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
it 'uses each direct allOf parent as its Ruby superclass' do
|
|
61
|
+
mismatches = schemas.filter_map do |name, schema|
|
|
62
|
+
parents = Array(schema['allOf']).filter_map { |parent| parent['$ref']&.split('/')&.last }
|
|
63
|
+
next unless parents.size == 1
|
|
64
|
+
|
|
65
|
+
model = PCPServerSDK::Models.const_get(name)
|
|
66
|
+
parent = PCPServerSDK::Models.const_get(parents.first)
|
|
67
|
+
"#{name}: expected #{parent}, got #{model.superclass}" unless model.superclass == parent
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
expect(mismatches).to be_empty
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
it 'inherits parent attribute accessors instead of redeclaring them' do
|
|
74
|
+
mismatches = schemas.filter_map do |name, schema|
|
|
75
|
+
parents = Array(schema['allOf']).filter_map { |parent| parent['$ref']&.split('/')&.last }
|
|
76
|
+
next unless parents.size == 1
|
|
77
|
+
|
|
78
|
+
model = PCPServerSDK::Models.const_get(name)
|
|
79
|
+
parent = PCPServerSDK::Models.const_get(parents.first)
|
|
80
|
+
redeclared = parent.attribute_map.keys.select do |attribute|
|
|
81
|
+
model.instance_method(attribute).owner == model
|
|
82
|
+
end
|
|
83
|
+
"#{name}: redeclares #{redeclared}" unless redeclared.empty?
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
expect(mismatches).to be_empty
|
|
87
|
+
end
|
|
88
|
+
end
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require_relative '../../lib/PCP-server-Ruby-SDK'
|
|
3
|
+
|
|
4
|
+
module PCPServerSDK
|
|
5
|
+
module Models
|
|
6
|
+
class ModelBaseSpecNestedModel < ModelBase
|
|
7
|
+
attribute :name, :name, :String
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
class ModelBaseSpecModel < ModelBase
|
|
11
|
+
attribute :name, :name, :String
|
|
12
|
+
attribute :enabled, :enabled, :Boolean
|
|
13
|
+
attribute :count, :count, :Integer
|
|
14
|
+
attribute :items, :items, 'Array<ModelBaseSpecNestedModel>'
|
|
15
|
+
attribute :metadata, :metadata, 'Hash<String, ModelBaseSpecNestedModel>'
|
|
16
|
+
attribute :nested, :nested, :ModelBaseSpecNestedModel
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class ModelBaseSpecParentModel < ModelBase
|
|
20
|
+
attribute :enabled, :enabled, :Boolean, default: false
|
|
21
|
+
attribute :state, :state, :String, enum: ['ACTIVE']
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
class ModelBaseSpecChildModel < ModelBaseSpecParentModel
|
|
25
|
+
attribute :name, :name, :String
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
RSpec.describe PCPServerSDK::Models::ModelBase do
|
|
31
|
+
let(:model_class) { PCPServerSDK::Models::ModelBaseSpecModel }
|
|
32
|
+
|
|
33
|
+
it 'deserializes primitives, arrays, hashes, and nested models from JSON hashes' do
|
|
34
|
+
model = model_class.build_from_hash(
|
|
35
|
+
'name' => 'model',
|
|
36
|
+
'enabled' => 'false',
|
|
37
|
+
'count' => '12',
|
|
38
|
+
'items' => [{ 'name' => 'one' }],
|
|
39
|
+
'metadata' => { 'first' => { 'name' => 'two' } },
|
|
40
|
+
'nested' => { 'name' => 'three' }
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
expect(model.name).to eq('model')
|
|
44
|
+
expect(model.enabled).to be(false)
|
|
45
|
+
expect(model.count).to eq(12)
|
|
46
|
+
expect(model.items.first.name).to eq('one')
|
|
47
|
+
expect(model.metadata['first'].name).to eq('two')
|
|
48
|
+
expect(model.nested.name).to eq('three')
|
|
49
|
+
expect(model.to_hash).to eq(
|
|
50
|
+
name: 'model', enabled: false, count: 12,
|
|
51
|
+
items: [{ name: 'one' }], metadata: { 'first' => { name: 'two' } }, nested: { name: 'three' }
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
it 'preserves nil values from JSON hashes without serializing them' do
|
|
56
|
+
model = model_class.build_from_hash(
|
|
57
|
+
'name' => nil,
|
|
58
|
+
'items' => nil,
|
|
59
|
+
'metadata' => nil,
|
|
60
|
+
'nested' => nil
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
expect(model.name).to be_nil
|
|
64
|
+
expect(model.items).to be_nil
|
|
65
|
+
expect(model.metadata).to be_nil
|
|
66
|
+
expect(model.nested).to be_nil
|
|
67
|
+
expect(model.to_hash).to be_empty
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
it 'rejects unknown attributes and serializes only assigned values' do
|
|
71
|
+
expect { model_class.new(unknown: true) }.to raise_error(ArgumentError, '`unknown` is not a valid attribute')
|
|
72
|
+
expect(model_class.new(name: 'one').to_hash).to eq(name: 'one')
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
it 'drops nil entries from arrays during serialization' do
|
|
76
|
+
model = model_class.new(items: [nil, PCPServerSDK::Models::ModelBaseSpecNestedModel.new(name: 'one')])
|
|
77
|
+
|
|
78
|
+
expect(model.to_hash).to eq(items: [{ name: 'one' }])
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
it 'inherits defaults and enum validation' do
|
|
82
|
+
model = PCPServerSDK::Models::ModelBaseSpecChildModel.new(name: 'child')
|
|
83
|
+
|
|
84
|
+
expect(model.enabled).to be(false)
|
|
85
|
+
expect { model.state = 'INACTIVE' }.to raise_error(ArgumentError, 'invalid value for "state", must be one of ["ACTIVE"].')
|
|
86
|
+
end
|
|
87
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require_relative '../../lib/PCP-server-Ruby-SDK'
|
|
3
|
+
|
|
4
|
+
RSpec.describe 'Pay-by-link models' do
|
|
5
|
+
it 'serializes required request properties and deserializes the response structure' do
|
|
6
|
+
request = PCPServerSDK::Models::CreatePayByLinkRequest.new(
|
|
7
|
+
payment_link_specific_input: PCPServerSDK::Models::PaymentLinkSpecificInput.new(
|
|
8
|
+
authorization_mode: 'SALE',
|
|
9
|
+
payment_methods: ['840'],
|
|
10
|
+
return_url: 'https://merchant.example/complete'
|
|
11
|
+
),
|
|
12
|
+
order_type: 'FULL',
|
|
13
|
+
order_references: PCPServerSDK::Models::References.new(merchant_reference: 'order-123')
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
expect(request.to_hash).to include(
|
|
17
|
+
paymentLinkSpecificInput: {
|
|
18
|
+
authorizationMode: 'SALE',
|
|
19
|
+
paymentMethods: ['840'],
|
|
20
|
+
returnUrl: 'https://merchant.example/complete'
|
|
21
|
+
},
|
|
22
|
+
orderType: 'FULL',
|
|
23
|
+
orderReferences: { merchantReference: 'order-123' }
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
response = PCPServerSDK::Models::CreatePayByLinkResponse.build_from_hash(
|
|
27
|
+
'expirationDate' => '2026-09-22T12:00:00Z',
|
|
28
|
+
'paymentLinkOrder' => {
|
|
29
|
+
'merchantReference' => 'order-123',
|
|
30
|
+
'amount' => { 'amount' => 1200, 'currencyCode' => 'EUR' }
|
|
31
|
+
},
|
|
32
|
+
'status' => 'ACTIVE',
|
|
33
|
+
'redirectionUrl' => 'https://commerce.example/pay/link',
|
|
34
|
+
'paymentLinkId' => '707ef15b-7a0a-48f2-b7d8-c95103418a9c'
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
expect(response.expiration_date).to be_a(Time)
|
|
38
|
+
expect(response.payment_link_order).to be_a(PCPServerSDK::Models::PaymentLinkOrder)
|
|
39
|
+
expect(response.payment_link_order.amount).to be_a(PCPServerSDK::Models::AmountOfMoney)
|
|
40
|
+
expect(response.payment_link_order.amount.amount).to eq(1200)
|
|
41
|
+
expect(response.payment_link_order.amount.currency_code).to eq('EUR')
|
|
42
|
+
expect(response.status).to eq('ACTIVE')
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it 'enforces the required request fields from the OpenAPI schema' do
|
|
46
|
+
expect do
|
|
47
|
+
PCPServerSDK::Models::CreatePayByLinkRequest.new(order_type: 'FULL')
|
|
48
|
+
end.to raise_error(ArgumentError, 'payment_link_specific_input cannot be nil')
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require_relative '../../lib/PCP-server-Ruby-SDK'
|
|
3
|
+
|
|
4
|
+
RSpec.describe 'Payment intent models' do
|
|
5
|
+
it 'deserializes and serializes nested payment intent data' do
|
|
6
|
+
request = PCPServerSDK::Models::CreatePaymentIntentRequest.build_from_hash(
|
|
7
|
+
'amountOfMoney' => { 'amount' => 1200, 'currencyCode' => 'EUR' },
|
|
8
|
+
'references' => { 'merchantReference' => 'subscription-123' },
|
|
9
|
+
'shoppingCart' => {
|
|
10
|
+
'items' => [{ 'invoiceData' => { 'description' => 'Subscription' } }]
|
|
11
|
+
},
|
|
12
|
+
'paymentMethodSpecificInput' => {
|
|
13
|
+
'redirectPaymentMethodSpecificInput' => {
|
|
14
|
+
'requiresApproval' => false,
|
|
15
|
+
'paymentProductId' => 840,
|
|
16
|
+
'paymentProduct840SpecificInput' => { 'javaScriptSdkFlow' => true }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
expect(request.amount_of_money).to be_a(PCPServerSDK::Models::AmountOfMoney)
|
|
22
|
+
expect(request.references).to be_a(PCPServerSDK::Models::PaymentReferencesForPaymentIntent)
|
|
23
|
+
expect(request.shopping_cart.items.first).to be_a(PCPServerSDK::Models::CartItemData)
|
|
24
|
+
expect(request.payment_method_specific_input.redirect_payment_method_specific_input.requires_approval).to be(false)
|
|
25
|
+
expect(request.to_hash.dig(:shoppingCart, :items, 0, :invoiceData, :description)).to eq('Subscription')
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it 'uses the payment-intent PayPal account structure' do
|
|
29
|
+
response = PCPServerSDK::Models::PaymentIntentResponse.build_from_hash(
|
|
30
|
+
'redirectPaymentMethodSpecificOutput' => {
|
|
31
|
+
'paymentProduct840SpecificOutput' => {
|
|
32
|
+
'customerAccount' => { 'emailAddress' => 'customer@example.com' }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
customer_account = response.redirect_payment_method_specific_output.payment_product840_specific_output.customer_account
|
|
38
|
+
|
|
39
|
+
expect(customer_account).to be_a(PCPServerSDK::Models::PaymentProduct840CustomerAccountForIntent)
|
|
40
|
+
expect(customer_account.email_address).to eq('customer@example.com')
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
it 'uses the regular PayPal account structure outside payment intents' do
|
|
44
|
+
output = PCPServerSDK::Models::PaymentProduct840SpecificOutput.build_from_hash(
|
|
45
|
+
'customerAccount' => { 'payerId' => 'payer-123' }
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
expect(output.customer_account).to be_a(PCPServerSDK::Models::PaymentProduct840CustomerAccount)
|
|
49
|
+
expect(output.customer_account.payer_id).to eq('payer-123')
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -275,7 +275,7 @@ RSpec.describe 'required field validation' do
|
|
|
275
275
|
describe PCPServerSDK::Models::FundDistribution do
|
|
276
276
|
it 'rejects partially initialized models missing the first required field' do
|
|
277
277
|
expect do
|
|
278
|
-
described_class.new(amount: 100, type: '
|
|
278
|
+
described_class.new(amount: 100, type: 'COMMISSION_FEE')
|
|
279
279
|
end.to raise_error(ArgumentError, 'account_id cannot be nil')
|
|
280
280
|
end
|
|
281
281
|
|
|
@@ -463,7 +463,7 @@ RSpec.describe 'required field validation' do
|
|
|
463
463
|
let(:fund_split) do
|
|
464
464
|
PCPServerSDK::Models::FundSplit.new(
|
|
465
465
|
fund_distributions: [
|
|
466
|
-
PCPServerSDK::Models::FundDistribution.new(account_id: 'account-1', amount: 100, type: '
|
|
466
|
+
PCPServerSDK::Models::FundDistribution.new(account_id: 'account-1', amount: 100, type: 'COMMISSION_FEE')
|
|
467
467
|
]
|
|
468
468
|
)
|
|
469
469
|
end
|
|
@@ -478,7 +478,7 @@ RSpec.describe 'required field validation' do
|
|
|
478
478
|
{
|
|
479
479
|
accountId: 'account-1',
|
|
480
480
|
amount: 100,
|
|
481
|
-
type: '
|
|
481
|
+
type: 'COMMISSION_FEE'
|
|
482
482
|
}
|
|
483
483
|
]
|
|
484
484
|
}
|
|
@@ -493,7 +493,7 @@ RSpec.describe 'required field validation' do
|
|
|
493
493
|
{
|
|
494
494
|
'accountId' => 'account-1',
|
|
495
495
|
'amount' => 100,
|
|
496
|
-
'type' => '
|
|
496
|
+
'type' => 'COMMISSION_FEE'
|
|
497
497
|
}
|
|
498
498
|
]
|
|
499
499
|
}
|
|
@@ -512,7 +512,7 @@ RSpec.describe 'required field validation' do
|
|
|
512
512
|
{
|
|
513
513
|
'accountId' => 'account-1',
|
|
514
514
|
'amount' => 100,
|
|
515
|
-
'type' => '
|
|
515
|
+
'type' => 'COMMISSION_FEE'
|
|
516
516
|
}
|
|
517
517
|
]
|
|
518
518
|
}
|
|
@@ -181,4 +181,19 @@ RSpec.describe PCPServerSDK::Queries::GetCheckoutsQuery do
|
|
|
181
181
|
@query.company_information = 'Company XYZ'
|
|
182
182
|
expect(@query.to_query_map).to eq({ 'companyInformation' => 'Company XYZ' })
|
|
183
183
|
end
|
|
184
|
+
|
|
185
|
+
it 'should return query map with card_authorization_id' do
|
|
186
|
+
@query.card_authorization_id = 'authorization-123'
|
|
187
|
+
expect(@query.to_query_map).to eq({ 'cardAuthorizationId' => 'authorization-123' })
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
it 'should return query map with receipt_number' do
|
|
191
|
+
@query.receipt_number = 'receipt-123'
|
|
192
|
+
expect(@query.to_query_map).to eq({ 'receiptNumber' => 'receipt-123' })
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
it 'should return query map with trace_number' do
|
|
196
|
+
@query.trace_number = 'trace-123'
|
|
197
|
+
expect(@query.to_query_map).to eq({ 'traceNumber' => 'trace-123' })
|
|
198
|
+
end
|
|
184
199
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pcp-server-ruby-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.14.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- PAYONE GmbH
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-09-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: net-http
|
|
@@ -107,12 +107,13 @@ files:
|
|
|
107
107
|
- lib/PCP-server-Ruby-SDK/endpoints/checkout_api_client.rb
|
|
108
108
|
- lib/PCP-server-Ruby-SDK/endpoints/commerce_case_api_client.rb
|
|
109
109
|
- lib/PCP-server-Ruby-SDK/endpoints/order_management_checkout_actions_api_client.rb
|
|
110
|
+
- lib/PCP-server-Ruby-SDK/endpoints/pay_by_link_api_client.rb
|
|
110
111
|
- lib/PCP-server-Ruby-SDK/endpoints/payment_execution_api_client.rb
|
|
111
112
|
- lib/PCP-server-Ruby-SDK/endpoints/payment_information_api_client.rb
|
|
113
|
+
- lib/PCP-server-Ruby-SDK/endpoints/payment_intent_api_client.rb
|
|
112
114
|
- lib/PCP-server-Ruby-SDK/errors/api_error_response_exception.rb
|
|
113
115
|
- lib/PCP-server-Ruby-SDK/errors/api_exception.rb
|
|
114
116
|
- lib/PCP-server-Ruby-SDK/errors/api_response_retrieval_exception.rb
|
|
115
|
-
- lib/PCP-server-Ruby-SDK/models/action_type.rb
|
|
116
117
|
- lib/PCP-server-Ruby-SDK/models/address.rb
|
|
117
118
|
- lib/PCP-server-Ruby-SDK/models/address_personal.rb
|
|
118
119
|
- lib/PCP-server-Ruby-SDK/models/allowed_payment_actions.rb
|
|
@@ -130,10 +131,8 @@ files:
|
|
|
130
131
|
- lib/PCP-server-Ruby-SDK/models/applepay/apple_pay_payment_token.rb
|
|
131
132
|
- lib/PCP-server-Ruby-SDK/models/authentication_token.rb
|
|
132
133
|
- lib/PCP-server-Ruby-SDK/models/authorization_mode.rb
|
|
133
|
-
- lib/PCP-server-Ruby-SDK/models/avs_result.rb
|
|
134
134
|
- lib/PCP-server-Ruby-SDK/models/bank_account_information.rb
|
|
135
135
|
- lib/PCP-server-Ruby-SDK/models/bank_payout_method_specific_input.rb
|
|
136
|
-
- lib/PCP-server-Ruby-SDK/models/business_relation.rb
|
|
137
136
|
- lib/PCP-server-Ruby-SDK/models/cancel_item.rb
|
|
138
137
|
- lib/PCP-server-Ruby-SDK/models/cancel_payment_request.rb
|
|
139
138
|
- lib/PCP-server-Ruby-SDK/models/cancel_payment_response.rb
|
|
@@ -150,6 +149,7 @@ files:
|
|
|
150
149
|
- lib/PCP-server-Ruby-SDK/models/card_payment_method_specific_input.rb
|
|
151
150
|
- lib/PCP-server-Ruby-SDK/models/card_payment_method_specific_output.rb
|
|
152
151
|
- lib/PCP-server-Ruby-SDK/models/card_recurrence_details.rb
|
|
152
|
+
- lib/PCP-server-Ruby-SDK/models/cart_item_data.rb
|
|
153
153
|
- lib/PCP-server-Ruby-SDK/models/cart_item_input.rb
|
|
154
154
|
- lib/PCP-server-Ruby-SDK/models/cart_item_invoice_data.rb
|
|
155
155
|
- lib/PCP-server-Ruby-SDK/models/cart_item_order_status.rb
|
|
@@ -175,6 +175,11 @@ files:
|
|
|
175
175
|
- lib/PCP-server-Ruby-SDK/models/create_checkout_response.rb
|
|
176
176
|
- lib/PCP-server-Ruby-SDK/models/create_commerce_case_request.rb
|
|
177
177
|
- lib/PCP-server-Ruby-SDK/models/create_commerce_case_response.rb
|
|
178
|
+
- lib/PCP-server-Ruby-SDK/models/create_pay_by_link_request.rb
|
|
179
|
+
- lib/PCP-server-Ruby-SDK/models/create_pay_by_link_response.rb
|
|
180
|
+
- lib/PCP-server-Ruby-SDK/models/create_payment_intent.rb
|
|
181
|
+
- lib/PCP-server-Ruby-SDK/models/create_payment_intent_request.rb
|
|
182
|
+
- lib/PCP-server-Ruby-SDK/models/create_payment_intent_response.rb
|
|
178
183
|
- lib/PCP-server-Ruby-SDK/models/create_payment_response.rb
|
|
179
184
|
- lib/PCP-server-Ruby-SDK/models/customer.rb
|
|
180
185
|
- lib/PCP-server-Ruby-SDK/models/customer_account.rb
|
|
@@ -200,6 +205,7 @@ files:
|
|
|
200
205
|
- lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_output.rb
|
|
201
206
|
- lib/PCP-server-Ruby-SDK/models/mobile_payment_network.rb
|
|
202
207
|
- lib/PCP-server-Ruby-SDK/models/mobile_payment_three_dsecure.rb
|
|
208
|
+
- lib/PCP-server-Ruby-SDK/models/model_base.rb
|
|
203
209
|
- lib/PCP-server-Ruby-SDK/models/order.rb
|
|
204
210
|
- lib/PCP-server-Ruby-SDK/models/order_item.rb
|
|
205
211
|
- lib/PCP-server-Ruby-SDK/models/order_line_details_input.rb
|
|
@@ -212,6 +218,7 @@ files:
|
|
|
212
218
|
- lib/PCP-server-Ruby-SDK/models/patch_commerce_case_request.rb
|
|
213
219
|
- lib/PCP-server-Ruby-SDK/models/pause_payment_request.rb
|
|
214
220
|
- lib/PCP-server-Ruby-SDK/models/pause_payment_response.rb
|
|
221
|
+
- lib/PCP-server-Ruby-SDK/models/pay_link_status_value.rb
|
|
215
222
|
- lib/PCP-server-Ruby-SDK/models/payee.rb
|
|
216
223
|
- lib/PCP-server-Ruby-SDK/models/payment_channel.rb
|
|
217
224
|
- lib/PCP-server-Ruby-SDK/models/payment_creation_output.rb
|
|
@@ -224,7 +231,13 @@ files:
|
|
|
224
231
|
- lib/PCP-server-Ruby-SDK/models/payment_information_request.rb
|
|
225
232
|
- lib/PCP-server-Ruby-SDK/models/payment_information_response.rb
|
|
226
233
|
- lib/PCP-server-Ruby-SDK/models/payment_instructions.rb
|
|
234
|
+
- lib/PCP-server-Ruby-SDK/models/payment_intent_output.rb
|
|
235
|
+
- lib/PCP-server-Ruby-SDK/models/payment_intent_response.rb
|
|
236
|
+
- lib/PCP-server-Ruby-SDK/models/payment_intent_response_data.rb
|
|
237
|
+
- lib/PCP-server-Ruby-SDK/models/payment_link_order.rb
|
|
238
|
+
- lib/PCP-server-Ruby-SDK/models/payment_link_specific_input.rb
|
|
227
239
|
- lib/PCP-server-Ruby-SDK/models/payment_method_specific_input.rb
|
|
240
|
+
- lib/PCP-server-Ruby-SDK/models/payment_method_specific_input_for_intent.rb
|
|
228
241
|
- lib/PCP-server-Ruby-SDK/models/payment_output.rb
|
|
229
242
|
- lib/PCP-server-Ruby-SDK/models/payment_product302_specific_input.rb
|
|
230
243
|
- lib/PCP-server-Ruby-SDK/models/payment_product3391_specific_input.rb
|
|
@@ -233,8 +246,11 @@ files:
|
|
|
233
246
|
- lib/PCP-server-Ruby-SDK/models/payment_product5002_specific_input.rb
|
|
234
247
|
- lib/PCP-server-Ruby-SDK/models/payment_product771_specific_output.rb
|
|
235
248
|
- lib/PCP-server-Ruby-SDK/models/payment_product840_customer_account.rb
|
|
249
|
+
- lib/PCP-server-Ruby-SDK/models/payment_product840_customer_account_for_intent.rb
|
|
236
250
|
- lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output.rb
|
|
251
|
+
- lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output_for_intent.rb
|
|
237
252
|
- lib/PCP-server-Ruby-SDK/models/payment_references.rb
|
|
253
|
+
- lib/PCP-server-Ruby-SDK/models/payment_references_for_payment_intent.rb
|
|
238
254
|
- lib/PCP-server-Ruby-SDK/models/payment_references_for_refund.rb
|
|
239
255
|
- lib/PCP-server-Ruby-SDK/models/payment_response.rb
|
|
240
256
|
- lib/PCP-server-Ruby-SDK/models/payment_status_output.rb
|
|
@@ -249,8 +265,12 @@ files:
|
|
|
249
265
|
- lib/PCP-server-Ruby-SDK/models/recurring_payment_sequence_indicator.rb
|
|
250
266
|
- lib/PCP-server-Ruby-SDK/models/redirect_data.rb
|
|
251
267
|
- lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input.rb
|
|
268
|
+
- lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input_for_intent.rb
|
|
252
269
|
- lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output.rb
|
|
270
|
+
- lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output_for_create_intent.rb
|
|
271
|
+
- lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output_for_intent.rb
|
|
253
272
|
- lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input.rb
|
|
273
|
+
- lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input_data.rb
|
|
254
274
|
- lib/PCP-server-Ruby-SDK/models/redirect_payment_product900_specific_input.rb
|
|
255
275
|
- lib/PCP-server-Ruby-SDK/models/redirection_data.rb
|
|
256
276
|
- lib/PCP-server-Ruby-SDK/models/references.rb
|
|
@@ -271,6 +291,8 @@ files:
|
|
|
271
291
|
- lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_product771_specific_input.rb
|
|
272
292
|
- lib/PCP-server-Ruby-SDK/models/sepa_transfer_payment_product_772_specific_input.rb
|
|
273
293
|
- lib/PCP-server-Ruby-SDK/models/shipping.rb
|
|
294
|
+
- lib/PCP-server-Ruby-SDK/models/shipping_address.rb
|
|
295
|
+
- lib/PCP-server-Ruby-SDK/models/shopping_cart_data.rb
|
|
274
296
|
- lib/PCP-server-Ruby-SDK/models/shopping_cart_input.rb
|
|
275
297
|
- lib/PCP-server-Ruby-SDK/models/shopping_cart_patch.rb
|
|
276
298
|
- lib/PCP-server-Ruby-SDK/models/shopping_cart_result.rb
|
|
@@ -291,6 +313,7 @@ files:
|
|
|
291
313
|
- package-lock.json
|
|
292
314
|
- package.json
|
|
293
315
|
- scripts.sh
|
|
316
|
+
- scripts/convert_models_to_model_base.rb
|
|
294
317
|
- sonar-project.properties
|
|
295
318
|
- spec/communicator_configuration_spec.rb
|
|
296
319
|
- spec/endpoints/authentication_api_client_spec.rb
|
|
@@ -298,11 +321,17 @@ files:
|
|
|
298
321
|
- spec/endpoints/checkout_api_client_spec.rb
|
|
299
322
|
- spec/endpoints/commerce_case_api_client_spec.rb
|
|
300
323
|
- spec/endpoints/order_management_checkout_actions_api_client_spec.rb
|
|
324
|
+
- spec/endpoints/pay_by_link_api_client_spec.rb
|
|
301
325
|
- spec/endpoints/payment_execution_api_client_spec.rb
|
|
302
326
|
- spec/endpoints/payment_information_api_client_spec.rb
|
|
327
|
+
- spec/endpoints/payment_intent_api_client_spec.rb
|
|
303
328
|
- spec/errors/api_error_response_exception_spec.rb
|
|
304
329
|
- spec/errors/api_exception_spec.rb
|
|
305
330
|
- spec/errors/api_response_retrieval_exception_spec.rb
|
|
331
|
+
- spec/models/api_definition_conformance_spec.rb
|
|
332
|
+
- spec/models/model_base_spec.rb
|
|
333
|
+
- spec/models/pay_by_link_models_spec.rb
|
|
334
|
+
- spec/models/payment_intent_models_spec.rb
|
|
306
335
|
- spec/models/required_field_validation_spec.rb
|
|
307
336
|
- spec/queries/get_checkouts_query_spec.rb
|
|
308
337
|
- spec/queries/get_commerce_cases_query_spec.rb
|
|
@@ -335,19 +364,25 @@ specification_version: 4
|
|
|
335
364
|
summary: Commerce Platform API Ruby Gem
|
|
336
365
|
test_files:
|
|
337
366
|
- spec/communicator_configuration_spec.rb
|
|
367
|
+
- spec/endpoints/checkout_api_client_spec.rb
|
|
338
368
|
- spec/endpoints/payment_execution_api_client_spec.rb
|
|
369
|
+
- spec/endpoints/pay_by_link_api_client_spec.rb
|
|
339
370
|
- spec/endpoints/base_api_client_spec.rb
|
|
340
|
-
- spec/endpoints/commerce_case_api_client_spec.rb
|
|
341
|
-
- spec/endpoints/checkout_api_client_spec.rb
|
|
342
|
-
- spec/endpoints/payment_information_api_client_spec.rb
|
|
343
371
|
- spec/endpoints/order_management_checkout_actions_api_client_spec.rb
|
|
372
|
+
- spec/endpoints/payment_information_api_client_spec.rb
|
|
344
373
|
- spec/endpoints/authentication_api_client_spec.rb
|
|
345
|
-
- spec/
|
|
374
|
+
- spec/endpoints/payment_intent_api_client_spec.rb
|
|
375
|
+
- spec/endpoints/commerce_case_api_client_spec.rb
|
|
346
376
|
- spec/errors/api_exception_spec.rb
|
|
347
377
|
- spec/errors/api_response_retrieval_exception_spec.rb
|
|
378
|
+
- spec/errors/api_error_response_exception_spec.rb
|
|
379
|
+
- spec/models/model_base_spec.rb
|
|
348
380
|
- spec/models/required_field_validation_spec.rb
|
|
349
|
-
- spec/
|
|
381
|
+
- spec/models/pay_by_link_models_spec.rb
|
|
382
|
+
- spec/models/payment_intent_models_spec.rb
|
|
383
|
+
- spec/models/api_definition_conformance_spec.rb
|
|
350
384
|
- spec/queries/get_checkouts_query_spec.rb
|
|
385
|
+
- spec/queries/get_commerce_cases_query_spec.rb
|
|
351
386
|
- spec/request_header_generator_spec.rb
|
|
352
387
|
- spec/spec_helper.rb
|
|
353
388
|
- spec/transformer/apple_pay_transformer_spec.rb
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
require 'date'
|
|
2
|
-
require 'time'
|
|
3
|
-
|
|
4
|
-
module PCPServerSDK
|
|
5
|
-
module Models
|
|
6
|
-
class ActionType
|
|
7
|
-
REDIRECT = "REDIRECT".freeze # The customer needs to be redirected using the details found in redirectData
|
|
8
|
-
SHOW_FORM = "SHOW_FORM".freeze # The customer needs to be shown a form with the fields found in formFields
|
|
9
|
-
SHOW_INSTRUCTIONS = "SHOW_INSTRUCTIONS".freeze # The customer needs to be shown payment instruction using the details found in showData
|
|
10
|
-
SHOW_TRANSACTION_RESULTS = "SHOW_TRANSACTION_RESULTS".freeze # The customer needs to be shown the transaction results using the details found in showData
|
|
11
|
-
MOBILE_THREEDS_CHALLENGE = "MOBILE_THREEDS_CHALLENGE".freeze # The customer needs to complete a challenge as part of the 3D Secure authentication inside your mobile app
|
|
12
|
-
CALL_THIRD_PARTY = "CALL_THIRD_PARTY".freeze # The merchant needs to call a third party using the data found in thirdPartyData
|
|
13
|
-
|
|
14
|
-
def self.all_vars
|
|
15
|
-
@all_vars ||= [REDIRECT, SHOW_FORM, SHOW_INSTRUCTIONS, SHOW_TRANSACTION_RESULTS, MOBILE_THREEDS_CHALLENGE, CALL_THIRD_PARTY].freeze
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
# Builds the enum from string
|
|
19
|
-
# @param [String] The enum value in the form of the string
|
|
20
|
-
# @return [String] The enum value
|
|
21
|
-
def self.build_from_hash(value)
|
|
22
|
-
new.build_from_hash(value)
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
# Builds the enum from string
|
|
26
|
-
# @param [String] The enum value in the form of the string
|
|
27
|
-
# @return [String] The enum value
|
|
28
|
-
def build_from_hash(value)
|
|
29
|
-
return value if ActionType.all_vars.include?(value)
|
|
30
|
-
raise "Invalid ENUM value #{value} for class #ActionType"
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
end
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
require 'date'
|
|
2
|
-
require 'time'
|
|
3
|
-
|
|
4
|
-
module PCPServerSDK
|
|
5
|
-
module Models
|
|
6
|
-
class AvsResult
|
|
7
|
-
A = "A".freeze # Address (Street) matches, Zip does not
|
|
8
|
-
B = "B".freeze # Street address match for international transactions—Postal code not verified due to incompatible formats
|
|
9
|
-
C = "C".freeze # Street address and postal code not verified for international transaction due to incompatible formats
|
|
10
|
-
D = "D".freeze # Street address and postal code match for international transaction, cardholder name is incorrect
|
|
11
|
-
E = "E".freeze # AVS error
|
|
12
|
-
F = "F".freeze # Address does match and five digit ZIP code does match (UK only)
|
|
13
|
-
G = "G".freeze # Address information is unavailable; international transaction; non-AVS participant
|
|
14
|
-
H = "H".freeze # Billing address and postal code match, cardholder name is incorrect (Amex)
|
|
15
|
-
I = "I".freeze # Address information not verified for international transaction
|
|
16
|
-
K = "K".freeze # Cardholder name matches (Amex)
|
|
17
|
-
L = "L".freeze # Cardholder name and postal code match (Amex)
|
|
18
|
-
M = "M".freeze # Cardholder name, street address, and postal code match for international transaction
|
|
19
|
-
N = "N".freeze # No Match on Address (Street) or Zip
|
|
20
|
-
O = "O".freeze # Cardholder name and address match (Amex)
|
|
21
|
-
P = "P".freeze # Postal codes match for international transaction—Street address not verified due to incompatible formats
|
|
22
|
-
Q = "Q".freeze # Billing address matches, cardholder is incorrect (Amex)
|
|
23
|
-
R = "R".freeze # Retry, System unavailable or Timed out
|
|
24
|
-
S = "S".freeze # Service not supported by issuer
|
|
25
|
-
U = "U".freeze # Address information is unavailable
|
|
26
|
-
W = "W".freeze # 9 digit Zip matches, Address (Street) does not
|
|
27
|
-
X = "X".freeze # Exact AVS Match
|
|
28
|
-
Y = "Y".freeze # Address (Street) and 5 digit Zip match
|
|
29
|
-
Z = "Z".freeze # 5 digit Zip matches, Address (Street) does not
|
|
30
|
-
ZERO = "0".freeze # No service available
|
|
31
|
-
|
|
32
|
-
def self.all_vars
|
|
33
|
-
@all_vars ||= [A, B, C, D, E, F, G, H, I, K, L, M, N, O, P, Q, R, S, U, W, X, Y, Z, ZERO].freeze
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
# Builds the enum from string
|
|
37
|
-
# @param [String] The enum value in the form of the string
|
|
38
|
-
# @return [String] The enum value
|
|
39
|
-
def self.build_from_hash(value)
|
|
40
|
-
new.build_from_hash(value)
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
# Builds the enum from string
|
|
44
|
-
# @param [String] The enum value in the form of the string
|
|
45
|
-
# @return [String] The enum value
|
|
46
|
-
def build_from_hash(value)
|
|
47
|
-
return value if AvsResult.all_vars.include?(value)
|
|
48
|
-
raise "Invalid ENUM value #{value} for class #AvsResult"
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
end
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
require 'date'
|
|
2
|
-
require 'time'
|
|
3
|
-
|
|
4
|
-
module PCPServerSDK
|
|
5
|
-
module Models
|
|
6
|
-
class BusinessRelation
|
|
7
|
-
B2C = "B2C".freeze # Indicates business to consumer
|
|
8
|
-
B2B = "B2B".freeze # Indicates business to business
|
|
9
|
-
|
|
10
|
-
def self.all_vars
|
|
11
|
-
@all_vars ||= [B2C, B2B].freeze
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
# Builds the enum from string
|
|
15
|
-
# @param [String] The enum value in the form of the string
|
|
16
|
-
# @return [String] The enum value
|
|
17
|
-
def self.build_from_hash(value)
|
|
18
|
-
new.build_from_hash(value)
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
# Builds the enum from string
|
|
22
|
-
# @param [String] The enum value in the form of the string
|
|
23
|
-
# @return [String] The enum value
|
|
24
|
-
def build_from_hash(value)
|
|
25
|
-
return value if BusinessRelation.all_vars.include?(value)
|
|
26
|
-
raise "Invalid ENUM value #{value} for class #BusinessRelation"
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|