paypal-server-sdk 0.5.2 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -18
- data/lib/paypal_server_sdk/controllers/base_controller.rb +1 -1
- data/lib/paypal_server_sdk/controllers/orders_controller.rb +64 -25
- data/lib/paypal_server_sdk/controllers/payments_controller.rb +53 -26
- data/lib/paypal_server_sdk/controllers/vault_controller.rb +4 -4
- data/lib/paypal_server_sdk/models/avs_code.rb +1 -1
- data/lib/paypal_server_sdk/models/blik_experience_context.rb +2 -2
- data/lib/paypal_server_sdk/models/blik_level0_payment_object.rb +2 -2
- data/lib/paypal_server_sdk/models/blik_one_click_payment_object.rb +2 -2
- data/lib/paypal_server_sdk/models/blik_one_click_payment_request.rb +2 -2
- data/lib/paypal_server_sdk/models/blik_payment_object.rb +4 -4
- data/lib/paypal_server_sdk/models/blik_payment_request.rb +8 -8
- data/lib/paypal_server_sdk/models/card_verification_details.rb +15 -2
- data/lib/paypal_server_sdk/models/card_verification_processor_response.rb +2 -2
- data/lib/paypal_server_sdk/models/confirm_order_request.rb +5 -8
- data/lib/paypal_server_sdk/models/cvv_code.rb +1 -1
- data/lib/paypal_server_sdk/models/eci_flag.rb +1 -1
- data/lib/paypal_server_sdk/models/eps_payment_object.rb +2 -2
- data/lib/paypal_server_sdk/models/eps_payment_request.rb +2 -2
- data/lib/paypal_server_sdk/models/{fullfillment_type.rb → fulfillment_type.rb} +2 -2
- data/lib/paypal_server_sdk/models/google_pay_card.rb +114 -0
- data/lib/paypal_server_sdk/models/google_pay_decrypted_token_data.rb +11 -2
- data/lib/paypal_server_sdk/models/ideal_payment_object.rb +2 -2
- data/lib/paypal_server_sdk/models/ideal_payment_request.rb +2 -2
- data/lib/paypal_server_sdk/models/link_description.rb +1 -1
- data/lib/paypal_server_sdk/models/link_http_method.rb +1 -1
- data/lib/paypal_server_sdk/models/{my_bank_payment_object.rb → mybank_payment_object.rb} +2 -2
- data/lib/paypal_server_sdk/models/{my_bank_payment_request.rb → mybank_payment_request.rb} +2 -2
- data/lib/paypal_server_sdk/models/network_token.rb +1 -1
- data/lib/paypal_server_sdk/models/order.rb +12 -12
- data/lib/paypal_server_sdk/models/order_authorize_request_payment_source.rb +2 -2
- data/lib/paypal_server_sdk/models/order_authorize_response.rb +10 -10
- data/lib/paypal_server_sdk/models/order_authorize_response_payment_source.rb +2 -2
- data/lib/paypal_server_sdk/models/order_capture_request_payment_source.rb +2 -2
- data/lib/paypal_server_sdk/models/pa_res_status.rb +1 -1
- data/lib/paypal_server_sdk/models/payment_source.rb +10 -10
- data/lib/paypal_server_sdk/models/payment_source_response.rb +10 -10
- data/lib/paypal_server_sdk/models/payment_token_response_payment_source.rb +2 -2
- data/lib/paypal_server_sdk/models/{pay_pal_experience_landing_page.rb → paypal_experience_landing_page.rb} +2 -2
- data/lib/paypal_server_sdk/models/{pay_pal_experience_user_action.rb → paypal_experience_user_action.rb} +2 -2
- data/lib/paypal_server_sdk/models/{pay_pal_payment_token.rb → paypal_payment_token.rb} +3 -3
- data/lib/paypal_server_sdk/models/{pay_pal_payment_token_customer_type.rb → paypal_payment_token_customer_type.rb} +2 -2
- data/lib/paypal_server_sdk/models/{pay_pal_payment_token_usage_pattern.rb → paypal_payment_token_usage_pattern.rb} +2 -2
- data/lib/paypal_server_sdk/models/{pay_pal_payment_token_usage_type.rb → paypal_payment_token_usage_type.rb} +2 -2
- data/lib/paypal_server_sdk/models/{pay_pal_wallet.rb → paypal_wallet.rb} +6 -6
- data/lib/paypal_server_sdk/models/{pay_pal_wallet_account_verification_status.rb → paypal_wallet_account_verification_status.rb} +2 -2
- data/lib/paypal_server_sdk/models/{pay_pal_wallet_attributes.rb → paypal_wallet_attributes.rb} +6 -6
- data/lib/paypal_server_sdk/models/{pay_pal_wallet_attributes_response.rb → paypal_wallet_attributes_response.rb} +4 -4
- data/lib/paypal_server_sdk/models/{pay_pal_wallet_customer.rb → paypal_wallet_customer.rb} +2 -2
- data/lib/paypal_server_sdk/models/{pay_pal_wallet_customer_request.rb → paypal_wallet_customer_request.rb} +3 -3
- data/lib/paypal_server_sdk/models/{pay_pal_wallet_experience_context.rb → paypal_wallet_experience_context.rb} +8 -8
- data/lib/paypal_server_sdk/models/{pay_pal_wallet_response.rb → paypal_wallet_response.rb} +5 -5
- data/lib/paypal_server_sdk/models/{pay_pal_wallet_vault_instruction.rb → paypal_wallet_vault_instruction.rb} +8 -8
- data/lib/paypal_server_sdk/models/{pay_pal_wallet_vault_response.rb → paypal_wallet_vault_response.rb} +5 -5
- data/lib/paypal_server_sdk/models/{pay_pal_wallet_vault_status.rb → paypal_wallet_vault_status.rb} +2 -2
- data/lib/paypal_server_sdk/models/portable_postal_address_medium_grained.rb +116 -0
- data/lib/paypal_server_sdk/models/processor_response.rb +2 -2
- data/lib/paypal_server_sdk/models/setup_token_request_payment_source.rb +2 -2
- data/lib/paypal_server_sdk/models/setup_token_response_payment_source.rb +2 -2
- data/lib/paypal_server_sdk/models/shipment_carrier.rb +325 -1
- data/lib/paypal_server_sdk/models/shipping_details.rb +1 -1
- data/lib/paypal_server_sdk/models/shipping_with_tracking_details.rb +1 -1
- data/lib/paypal_server_sdk/models/three_d_secure_authentication_response.rb +1 -1
- data/lib/paypal_server_sdk/models/universal_product_code.rb +1 -1
- data/lib/paypal_server_sdk/models/upc_type.rb +1 -1
- data/lib/paypal_server_sdk/models/{vault_pay_pal_wallet_request.rb → vault_paypal_wallet_request.rb} +2 -2
- data/lib/paypal_server_sdk/models/vaulted_digital_wallet_shipping_details.rb +1 -1
- data/lib/paypal_server_sdk.rb +24 -22
- metadata +25 -24
- data/lib/paypal_server_sdk/models/processing_instruction.rb +0 -23
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Information used to pay using BLIK one-click flow.
|
8
|
-
class
|
8
|
+
class BlikOneClickPaymentObject < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -46,7 +46,7 @@ module PaypalServerSdk
|
|
46
46
|
hash.key?('consumer_reference') ? hash['consumer_reference'] : SKIP
|
47
47
|
|
48
48
|
# Create object from extracted values.
|
49
|
-
|
49
|
+
BlikOneClickPaymentObject.new(consumer_reference: consumer_reference)
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Information used to pay using BLIK one-click flow.
|
8
|
-
class
|
8
|
+
class BlikOneClickPaymentRequest < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -73,7 +73,7 @@ module PaypalServerSdk
|
|
73
73
|
alias_key = hash.key?('alias_key') ? hash['alias_key'] : SKIP
|
74
74
|
|
75
75
|
# Create object from extracted values.
|
76
|
-
|
76
|
+
BlikOneClickPaymentRequest.new(consumer_reference: consumer_reference,
|
77
77
|
auth_code: auth_code,
|
78
78
|
alias_label: alias_label,
|
79
79
|
alias_key: alias_key)
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Information used to pay using BLIK.
|
8
|
-
class
|
8
|
+
class BlikPaymentObject < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -31,7 +31,7 @@ module PaypalServerSdk
|
|
31
31
|
attr_accessor :email
|
32
32
|
|
33
33
|
# Information used to pay using BLIK one-click flow.
|
34
|
-
# @return [
|
34
|
+
# @return [BlikOneClickPaymentObject]
|
35
35
|
attr_accessor :one_click
|
36
36
|
|
37
37
|
# A mapping from model property names to API property names.
|
@@ -74,10 +74,10 @@ module PaypalServerSdk
|
|
74
74
|
name = hash.key?('name') ? hash['name'] : SKIP
|
75
75
|
country_code = hash.key?('country_code') ? hash['country_code'] : SKIP
|
76
76
|
email = hash.key?('email') ? hash['email'] : SKIP
|
77
|
-
one_click =
|
77
|
+
one_click = BlikOneClickPaymentObject.from_hash(hash['one_click']) if hash['one_click']
|
78
78
|
|
79
79
|
# Create object from extracted values.
|
80
|
-
|
80
|
+
BlikPaymentObject.new(name: name,
|
81
81
|
country_code: country_code,
|
82
82
|
email: email,
|
83
83
|
one_click: one_click)
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Information needed to pay using BLIK.
|
8
|
-
class
|
8
|
+
class BlikPaymentRequest < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -32,15 +32,15 @@ module PaypalServerSdk
|
|
32
32
|
|
33
33
|
# Customizes the payer experience during the approval process for the BLIK
|
34
34
|
# payment.
|
35
|
-
# @return [
|
35
|
+
# @return [BlikExperienceContext]
|
36
36
|
attr_accessor :experience_context
|
37
37
|
|
38
38
|
# Information used to pay using BLIK level_0 flow.
|
39
|
-
# @return [
|
39
|
+
# @return [BlikLevel0PaymentObject]
|
40
40
|
attr_accessor :level_0
|
41
41
|
|
42
42
|
# Information used to pay using BLIK one-click flow.
|
43
|
-
# @return [
|
43
|
+
# @return [BlikOneClickPaymentRequest]
|
44
44
|
attr_accessor :one_click
|
45
45
|
|
46
46
|
# A mapping from model property names to API property names.
|
@@ -88,13 +88,13 @@ module PaypalServerSdk
|
|
88
88
|
name = hash.key?('name') ? hash['name'] : nil
|
89
89
|
country_code = hash.key?('country_code') ? hash['country_code'] : nil
|
90
90
|
email = hash.key?('email') ? hash['email'] : SKIP
|
91
|
-
experience_context =
|
91
|
+
experience_context = BlikExperienceContext.from_hash(hash['experience_context']) if
|
92
92
|
hash['experience_context']
|
93
|
-
level_0 =
|
94
|
-
one_click =
|
93
|
+
level_0 = BlikLevel0PaymentObject.from_hash(hash['level_0']) if hash['level_0']
|
94
|
+
one_click = BlikOneClickPaymentRequest.from_hash(hash['one_click']) if hash['one_click']
|
95
95
|
|
96
96
|
# Create object from extracted values.
|
97
|
-
|
97
|
+
BlikPaymentRequest.new(name: name,
|
98
98
|
country_code: country_code,
|
99
99
|
email: email,
|
100
100
|
experience_context: experience_context,
|
@@ -45,6 +45,12 @@ module PaypalServerSdk
|
|
45
45
|
# @return [CardVerificationProcessorResponse]
|
46
46
|
attr_accessor :processor_response
|
47
47
|
|
48
|
+
# DEPRECATED. This field is DEPRECATED. Please find the 3D secure
|
49
|
+
# authentication data in 'three_d_secure' object under
|
50
|
+
# 'authentication_result' object instead of the 'verification' field.
|
51
|
+
# @return [Object]
|
52
|
+
attr_accessor :three_d_secure
|
53
|
+
|
48
54
|
# A mapping from model property names to API property names.
|
49
55
|
def self.names
|
50
56
|
@_hash = {} if @_hash.nil?
|
@@ -54,6 +60,7 @@ module PaypalServerSdk
|
|
54
60
|
@_hash['time'] = 'time'
|
55
61
|
@_hash['amount'] = 'amount'
|
56
62
|
@_hash['processor_response'] = 'processor_response'
|
63
|
+
@_hash['three_d_secure'] = 'three_d_secure'
|
57
64
|
@_hash
|
58
65
|
end
|
59
66
|
|
@@ -66,6 +73,7 @@ module PaypalServerSdk
|
|
66
73
|
time
|
67
74
|
amount
|
68
75
|
processor_response
|
76
|
+
three_d_secure
|
69
77
|
]
|
70
78
|
end
|
71
79
|
|
@@ -75,13 +83,15 @@ module PaypalServerSdk
|
|
75
83
|
end
|
76
84
|
|
77
85
|
def initialize(network_transaction_id: SKIP, date: SKIP, network: SKIP,
|
78
|
-
time: SKIP, amount: SKIP, processor_response: SKIP
|
86
|
+
time: SKIP, amount: SKIP, processor_response: SKIP,
|
87
|
+
three_d_secure: SKIP)
|
79
88
|
@network_transaction_id = network_transaction_id unless network_transaction_id == SKIP
|
80
89
|
@date = date unless date == SKIP
|
81
90
|
@network = network unless network == SKIP
|
82
91
|
@time = time unless time == SKIP
|
83
92
|
@amount = amount unless amount == SKIP
|
84
93
|
@processor_response = processor_response unless processor_response == SKIP
|
94
|
+
@three_d_secure = three_d_secure unless three_d_secure == SKIP
|
85
95
|
end
|
86
96
|
|
87
97
|
# Creates an instance of the object from a hash.
|
@@ -98,6 +108,8 @@ module PaypalServerSdk
|
|
98
108
|
if hash['processor_response']
|
99
109
|
processor_response = CardVerificationProcessorResponse.from_hash(hash['processor_response'])
|
100
110
|
end
|
111
|
+
three_d_secure =
|
112
|
+
hash.key?('three_d_secure') ? hash['three_d_secure'] : SKIP
|
101
113
|
|
102
114
|
# Create object from extracted values.
|
103
115
|
CardVerificationDetails.new(network_transaction_id: network_transaction_id,
|
@@ -105,7 +117,8 @@ module PaypalServerSdk
|
|
105
117
|
network: network,
|
106
118
|
time: time,
|
107
119
|
amount: amount,
|
108
|
-
processor_response: processor_response
|
120
|
+
processor_response: processor_response,
|
121
|
+
three_d_secure: three_d_secure)
|
109
122
|
end
|
110
123
|
end
|
111
124
|
end
|
@@ -12,12 +12,12 @@ module PaypalServerSdk
|
|
12
12
|
|
13
13
|
# The address verification code for Visa, Discover, Mastercard, or American
|
14
14
|
# Express transactions.
|
15
|
-
# @return [
|
15
|
+
# @return [AvsCode]
|
16
16
|
attr_accessor :avs_code
|
17
17
|
|
18
18
|
# The card verification value code for for Visa, Discover, Mastercard, or
|
19
19
|
# American Express.
|
20
|
-
# @return [
|
20
|
+
# @return [CvvCode]
|
21
21
|
attr_accessor :cvv_code
|
22
22
|
|
23
23
|
# A mapping from model property names to API property names.
|
@@ -14,8 +14,8 @@ module PaypalServerSdk
|
|
14
14
|
# @return [PaymentSource]
|
15
15
|
attr_accessor :payment_source
|
16
16
|
|
17
|
-
# The
|
18
|
-
# @return [
|
17
|
+
# The payment source definition.
|
18
|
+
# @return [Object]
|
19
19
|
attr_accessor :processing_instruction
|
20
20
|
|
21
21
|
# Customizes the payer confirmation experience.
|
@@ -44,11 +44,8 @@ module PaypalServerSdk
|
|
44
44
|
[]
|
45
45
|
end
|
46
46
|
|
47
|
-
def initialize(
|
48
|
-
|
49
|
-
processing_instruction: ProcessingInstruction::NO_INSTRUCTION,
|
50
|
-
application_context: SKIP
|
51
|
-
)
|
47
|
+
def initialize(payment_source:, processing_instruction: SKIP,
|
48
|
+
application_context: SKIP)
|
52
49
|
@payment_source = payment_source
|
53
50
|
@processing_instruction = processing_instruction unless processing_instruction == SKIP
|
54
51
|
@application_context = application_context unless application_context == SKIP
|
@@ -61,7 +58,7 @@ module PaypalServerSdk
|
|
61
58
|
# Extract variables from the hash.
|
62
59
|
payment_source = PaymentSource.from_hash(hash['payment_source']) if hash['payment_source']
|
63
60
|
processing_instruction =
|
64
|
-
hash['processing_instruction']
|
61
|
+
hash.key?('processing_instruction') ? hash['processing_instruction'] : SKIP
|
65
62
|
application_context = OrderConfirmApplicationContext.from_hash(hash['application_context']) if
|
66
63
|
hash['application_context']
|
67
64
|
|
@@ -7,7 +7,7 @@ module PaypalServerSdk
|
|
7
7
|
# Electronic Commerce Indicator (ECI). The ECI value is part of the 2 data
|
8
8
|
# elements that indicate the transaction was processed electronically. This
|
9
9
|
# should be passed on the authorization transaction to the Gateway/Processor.
|
10
|
-
class
|
10
|
+
class EciFlag
|
11
11
|
ECI_FLAG = [
|
12
12
|
# TODO: Write general description for MASTERCARD_NON_3D_SECURE_TRANSACTION
|
13
13
|
MASTERCARD_NON_3D_SECURE_TRANSACTION = 'MASTERCARD_NON_3D_SECURE_TRANSACTION'.freeze,
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Information used to pay using eps.
|
8
|
-
class
|
8
|
+
class EpsPaymentObject < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -66,7 +66,7 @@ module PaypalServerSdk
|
|
66
66
|
bic = hash.key?('bic') ? hash['bic'] : SKIP
|
67
67
|
|
68
68
|
# Create object from extracted values.
|
69
|
-
|
69
|
+
EpsPaymentObject.new(name: name,
|
70
70
|
country_code: country_code,
|
71
71
|
bic: bic)
|
72
72
|
end
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Information needed to pay using eps.
|
8
|
-
class
|
8
|
+
class EpsPaymentRequest < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -65,7 +65,7 @@ module PaypalServerSdk
|
|
65
65
|
hash['experience_context']
|
66
66
|
|
67
67
|
# Create object from extracted values.
|
68
|
-
|
68
|
+
EpsPaymentRequest.new(name: name,
|
69
69
|
country_code: country_code,
|
70
70
|
experience_context: experience_context)
|
71
71
|
end
|
@@ -7,8 +7,8 @@ module PaypalServerSdk
|
|
7
7
|
# A classification for the method of purchase fulfillment (e.g shipping,
|
8
8
|
# in-store pickup, etc). Either `type` or `options` may be present, but not
|
9
9
|
# both.
|
10
|
-
class
|
11
|
-
|
10
|
+
class FulfillmentType
|
11
|
+
FULFILLMENT_TYPE = [
|
12
12
|
# TODO: Write general description for SHIPPING
|
13
13
|
SHIPPING = 'SHIPPING'.freeze,
|
14
14
|
|
@@ -0,0 +1,114 @@
|
|
1
|
+
# paypal_server_sdk
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module PaypalServerSdk
|
7
|
+
# The payment card used to fund a Google Pay payment. Can be a credit or debit
|
8
|
+
# card.
|
9
|
+
class GooglePayCard < BaseModel
|
10
|
+
SKIP = Object.new
|
11
|
+
private_constant :SKIP
|
12
|
+
|
13
|
+
# The card holder's name as it appears on the card.
|
14
|
+
# @return [String]
|
15
|
+
attr_accessor :name
|
16
|
+
|
17
|
+
# The primary account number (PAN) for the payment card.
|
18
|
+
# @return [String]
|
19
|
+
attr_accessor :number
|
20
|
+
|
21
|
+
# The year and month, in ISO-8601 `YYYY-MM` date format. See [Internet date
|
22
|
+
# and time format](https://tools.ietf.org/html/rfc3339#section-5.6).
|
23
|
+
# @return [String]
|
24
|
+
attr_accessor :expiry
|
25
|
+
|
26
|
+
# The last digits of the payment card.
|
27
|
+
# @return [String]
|
28
|
+
attr_accessor :last_digits
|
29
|
+
|
30
|
+
# Type of card. i.e Credit, Debit and so on.
|
31
|
+
# @return [CardType]
|
32
|
+
attr_accessor :type
|
33
|
+
|
34
|
+
# The card network or brand. Applies to credit, debit, gift, and payment
|
35
|
+
# cards.
|
36
|
+
# @return [CardBrand]
|
37
|
+
attr_accessor :brand
|
38
|
+
|
39
|
+
# The portable international postal address. Maps to
|
40
|
+
# [AddressValidationMetadata](https://github.com/googlei18n/libaddressinput/
|
41
|
+
# wiki/AddressValidationMetadata) and HTML 5.1 [Autofilling form controls:
|
42
|
+
# the autocomplete
|
43
|
+
# attribute](https://www.w3.org/TR/html51/sec-forms.html#autofilling-form-co
|
44
|
+
# ntrols-the-autocomplete-attribute).
|
45
|
+
# @return [PortablePostalAddressMediumGrained]
|
46
|
+
attr_accessor :billing_address
|
47
|
+
|
48
|
+
# A mapping from model property names to API property names.
|
49
|
+
def self.names
|
50
|
+
@_hash = {} if @_hash.nil?
|
51
|
+
@_hash['name'] = 'name'
|
52
|
+
@_hash['number'] = 'number'
|
53
|
+
@_hash['expiry'] = 'expiry'
|
54
|
+
@_hash['last_digits'] = 'last_digits'
|
55
|
+
@_hash['type'] = 'type'
|
56
|
+
@_hash['brand'] = 'brand'
|
57
|
+
@_hash['billing_address'] = 'billing_address'
|
58
|
+
@_hash
|
59
|
+
end
|
60
|
+
|
61
|
+
# An array for optional fields
|
62
|
+
def self.optionals
|
63
|
+
%w[
|
64
|
+
name
|
65
|
+
number
|
66
|
+
expiry
|
67
|
+
last_digits
|
68
|
+
type
|
69
|
+
brand
|
70
|
+
billing_address
|
71
|
+
]
|
72
|
+
end
|
73
|
+
|
74
|
+
# An array for nullable fields
|
75
|
+
def self.nullables
|
76
|
+
[]
|
77
|
+
end
|
78
|
+
|
79
|
+
def initialize(name: SKIP, number: SKIP, expiry: SKIP, last_digits: SKIP,
|
80
|
+
type: SKIP, brand: SKIP, billing_address: SKIP)
|
81
|
+
@name = name unless name == SKIP
|
82
|
+
@number = number unless number == SKIP
|
83
|
+
@expiry = expiry unless expiry == SKIP
|
84
|
+
@last_digits = last_digits unless last_digits == SKIP
|
85
|
+
@type = type unless type == SKIP
|
86
|
+
@brand = brand unless brand == SKIP
|
87
|
+
@billing_address = billing_address unless billing_address == SKIP
|
88
|
+
end
|
89
|
+
|
90
|
+
# Creates an instance of the object from a hash.
|
91
|
+
def self.from_hash(hash)
|
92
|
+
return nil unless hash
|
93
|
+
|
94
|
+
# Extract variables from the hash.
|
95
|
+
name = hash.key?('name') ? hash['name'] : SKIP
|
96
|
+
number = hash.key?('number') ? hash['number'] : SKIP
|
97
|
+
expiry = hash.key?('expiry') ? hash['expiry'] : SKIP
|
98
|
+
last_digits = hash.key?('last_digits') ? hash['last_digits'] : SKIP
|
99
|
+
type = hash.key?('type') ? hash['type'] : SKIP
|
100
|
+
brand = hash.key?('brand') ? hash['brand'] : SKIP
|
101
|
+
billing_address = PortablePostalAddressMediumGrained.from_hash(hash['billing_address']) if
|
102
|
+
hash['billing_address']
|
103
|
+
|
104
|
+
# Create object from extracted values.
|
105
|
+
GooglePayCard.new(name: name,
|
106
|
+
number: number,
|
107
|
+
expiry: expiry,
|
108
|
+
last_digits: last_digits,
|
109
|
+
type: type,
|
110
|
+
brand: brand,
|
111
|
+
billing_address: billing_address)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
@@ -24,6 +24,11 @@ module PaypalServerSdk
|
|
24
24
|
# @return [GooglePayPaymentMethod]
|
25
25
|
attr_accessor :payment_method
|
26
26
|
|
27
|
+
# The payment card used to fund a Google Pay payment. Can be a credit or
|
28
|
+
# debit card.
|
29
|
+
# @return [GooglePayCard]
|
30
|
+
attr_accessor :card
|
31
|
+
|
27
32
|
# Authentication Method which is used for the card transaction.
|
28
33
|
# @return [GooglePayAuthenticationMethod]
|
29
34
|
attr_accessor :authentication_method
|
@@ -46,6 +51,7 @@ module PaypalServerSdk
|
|
46
51
|
@_hash['message_id'] = 'message_id'
|
47
52
|
@_hash['message_expiration'] = 'message_expiration'
|
48
53
|
@_hash['payment_method'] = 'payment_method'
|
54
|
+
@_hash['card'] = 'card'
|
49
55
|
@_hash['authentication_method'] = 'authentication_method'
|
50
56
|
@_hash['cryptogram'] = 'cryptogram'
|
51
57
|
@_hash['eci_indicator'] = 'eci_indicator'
|
@@ -67,12 +73,13 @@ module PaypalServerSdk
|
|
67
73
|
[]
|
68
74
|
end
|
69
75
|
|
70
|
-
def initialize(payment_method:, authentication_method:,
|
71
|
-
message_expiration: SKIP, cryptogram: SKIP,
|
76
|
+
def initialize(payment_method:, card:, authentication_method:,
|
77
|
+
message_id: SKIP, message_expiration: SKIP, cryptogram: SKIP,
|
72
78
|
eci_indicator: SKIP)
|
73
79
|
@message_id = message_id unless message_id == SKIP
|
74
80
|
@message_expiration = message_expiration unless message_expiration == SKIP
|
75
81
|
@payment_method = payment_method
|
82
|
+
@card = card
|
76
83
|
@authentication_method = authentication_method
|
77
84
|
@cryptogram = cryptogram unless cryptogram == SKIP
|
78
85
|
@eci_indicator = eci_indicator unless eci_indicator == SKIP
|
@@ -85,6 +92,7 @@ module PaypalServerSdk
|
|
85
92
|
# Extract variables from the hash.
|
86
93
|
payment_method =
|
87
94
|
hash.key?('payment_method') ? hash['payment_method'] : nil
|
95
|
+
card = GooglePayCard.from_hash(hash['card']) if hash['card']
|
88
96
|
authentication_method =
|
89
97
|
hash.key?('authentication_method') ? hash['authentication_method'] : nil
|
90
98
|
message_id = hash.key?('message_id') ? hash['message_id'] : SKIP
|
@@ -95,6 +103,7 @@ module PaypalServerSdk
|
|
95
103
|
|
96
104
|
# Create object from extracted values.
|
97
105
|
GooglePayDecryptedTokenData.new(payment_method: payment_method,
|
106
|
+
card: card,
|
98
107
|
authentication_method: authentication_method,
|
99
108
|
message_id: message_id,
|
100
109
|
message_expiration: message_expiration,
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Information used to pay using iDEAL.
|
8
|
-
class
|
8
|
+
class IdealPaymentObject < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -76,7 +76,7 @@ module PaypalServerSdk
|
|
76
76
|
hash.key?('iban_last_chars') ? hash['iban_last_chars'] : SKIP
|
77
77
|
|
78
78
|
# Create object from extracted values.
|
79
|
-
|
79
|
+
IdealPaymentObject.new(name: name,
|
80
80
|
country_code: country_code,
|
81
81
|
bic: bic,
|
82
82
|
iban_last_chars: iban_last_chars)
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Information needed to pay using iDEAL.
|
8
|
-
class
|
8
|
+
class IdealPaymentRequest < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -74,7 +74,7 @@ module PaypalServerSdk
|
|
74
74
|
hash['experience_context']
|
75
75
|
|
76
76
|
# Create object from extracted values.
|
77
|
-
|
77
|
+
IdealPaymentRequest.new(name: name,
|
78
78
|
country_code: country_code,
|
79
79
|
bic: bic,
|
80
80
|
experience_context: experience_context)
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Information used to pay using MyBank.
|
8
|
-
class
|
8
|
+
class MybankPaymentObject < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -76,7 +76,7 @@ module PaypalServerSdk
|
|
76
76
|
hash.key?('iban_last_chars') ? hash['iban_last_chars'] : SKIP
|
77
77
|
|
78
78
|
# Create object from extracted values.
|
79
|
-
|
79
|
+
MybankPaymentObject.new(name: name,
|
80
80
|
country_code: country_code,
|
81
81
|
bic: bic,
|
82
82
|
iban_last_chars: iban_last_chars)
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Information needed to pay using MyBank.
|
8
|
-
class
|
8
|
+
class MybankPaymentRequest < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -65,7 +65,7 @@ module PaypalServerSdk
|
|
65
65
|
hash['experience_context']
|
66
66
|
|
67
67
|
# Create object from extracted values.
|
68
|
-
|
68
|
+
MybankPaymentRequest.new(name: name,
|
69
69
|
country_code: country_code,
|
70
70
|
experience_context: experience_context)
|
71
71
|
end
|
@@ -27,7 +27,7 @@ module PaypalServerSdk
|
|
27
27
|
# elements that indicate the transaction was processed electronically. This
|
28
28
|
# should be passed on the authorization transaction to the
|
29
29
|
# Gateway/Processor.
|
30
|
-
# @return [
|
30
|
+
# @return [EciFlag]
|
31
31
|
attr_accessor :eci_flag
|
32
32
|
|
33
33
|
# A TRID, or a Token Requestor ID, is an identifier used by merchants to
|
@@ -38,11 +38,13 @@ module PaypalServerSdk
|
|
38
38
|
# @return [CheckoutPaymentIntent]
|
39
39
|
attr_accessor :intent
|
40
40
|
|
41
|
-
# The
|
42
|
-
#
|
41
|
+
# The intent to either capture payment immediately or authorize a payment
|
42
|
+
# for an order after order creation.
|
43
|
+
# @return [Object]
|
43
44
|
attr_accessor :processing_instruction
|
44
45
|
|
45
|
-
# The
|
46
|
+
# The intent to either capture payment immediately or authorize a payment
|
47
|
+
# for an order after order creation.
|
46
48
|
# @return [Payer]
|
47
49
|
attr_accessor :payer
|
48
50
|
|
@@ -58,10 +60,10 @@ module PaypalServerSdk
|
|
58
60
|
attr_accessor :status
|
59
61
|
|
60
62
|
# An array of request-related HATEOAS links. To complete payer approval, use
|
61
|
-
# the `approve` link to redirect the payer. The API caller has
|
63
|
+
# the `approve` link to redirect the payer. The API caller has 6 hours
|
62
64
|
# (default setting, this which can be changed by your account manager to
|
63
65
|
# 24/48/72 hours to accommodate your use case) from the time the order is
|
64
|
-
# created, to redirect your payer. Once redirected, the API caller has
|
66
|
+
# created, to redirect your payer. Once redirected, the API caller has 6
|
65
67
|
# hours for the payer to approve the order and either authorize or capture
|
66
68
|
# the order. If you are not using the PayPal JavaScript SDK to initiate
|
67
69
|
# PayPal Checkout (in context) ensure that you include
|
@@ -108,12 +110,10 @@ module PaypalServerSdk
|
|
108
110
|
[]
|
109
111
|
end
|
110
112
|
|
111
|
-
def initialize(
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
payer: SKIP, purchase_units: SKIP, status: SKIP, links: SKIP
|
116
|
-
)
|
113
|
+
def initialize(create_time: SKIP, update_time: SKIP, id: SKIP,
|
114
|
+
payment_source: SKIP, intent: SKIP,
|
115
|
+
processing_instruction: SKIP, payer: SKIP,
|
116
|
+
purchase_units: SKIP, status: SKIP, links: SKIP)
|
117
117
|
@create_time = create_time unless create_time == SKIP
|
118
118
|
@update_time = update_time unless update_time == SKIP
|
119
119
|
@id = id unless id == SKIP
|
@@ -138,7 +138,7 @@ module PaypalServerSdk
|
|
138
138
|
hash['payment_source']
|
139
139
|
intent = hash.key?('intent') ? hash['intent'] : SKIP
|
140
140
|
processing_instruction =
|
141
|
-
hash['processing_instruction']
|
141
|
+
hash.key?('processing_instruction') ? hash['processing_instruction'] : SKIP
|
142
142
|
payer = Payer.from_hash(hash['payer']) if hash['payer']
|
143
143
|
# Parameter is an array, so we need to iterate through it
|
144
144
|
purchase_units = nil
|
@@ -26,7 +26,7 @@ module PaypalServerSdk
|
|
26
26
|
attr_accessor :token
|
27
27
|
|
28
28
|
# A resource that identifies a PayPal Wallet is used for payment.
|
29
|
-
# @return [
|
29
|
+
# @return [PaypalWallet]
|
30
30
|
attr_accessor :paypal
|
31
31
|
|
32
32
|
# Information needed to pay using ApplePay.
|
@@ -87,7 +87,7 @@ module PaypalServerSdk
|
|
87
87
|
# Extract variables from the hash.
|
88
88
|
card = CardRequest.from_hash(hash['card']) if hash['card']
|
89
89
|
token = Token.from_hash(hash['token']) if hash['token']
|
90
|
-
paypal =
|
90
|
+
paypal = PaypalWallet.from_hash(hash['paypal']) if hash['paypal']
|
91
91
|
apple_pay = ApplePayRequest.from_hash(hash['apple_pay']) if hash['apple_pay']
|
92
92
|
google_pay = GooglePayRequest.from_hash(hash['google_pay']) if hash['google_pay']
|
93
93
|
venmo = VenmoWalletRequest.from_hash(hash['venmo']) if hash['venmo']
|