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
@@ -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
|
|
@@ -101,12 +103,10 @@ module PaypalServerSdk
|
|
101
103
|
[]
|
102
104
|
end
|
103
105
|
|
104
|
-
def initialize(
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
payer: SKIP, purchase_units: SKIP, status: SKIP, links: SKIP
|
109
|
-
)
|
106
|
+
def initialize(create_time: SKIP, update_time: SKIP, id: SKIP,
|
107
|
+
payment_source: SKIP, intent: SKIP,
|
108
|
+
processing_instruction: SKIP, payer: SKIP,
|
109
|
+
purchase_units: SKIP, status: SKIP, links: SKIP)
|
110
110
|
@create_time = create_time unless create_time == SKIP
|
111
111
|
@update_time = update_time unless update_time == SKIP
|
112
112
|
@id = id unless id == SKIP
|
@@ -131,7 +131,7 @@ module PaypalServerSdk
|
|
131
131
|
hash['payment_source']
|
132
132
|
intent = hash.key?('intent') ? hash['intent'] : SKIP
|
133
133
|
processing_instruction =
|
134
|
-
hash['processing_instruction']
|
134
|
+
hash.key?('processing_instruction') ? hash['processing_instruction'] : SKIP
|
135
135
|
payer = Payer.from_hash(hash['payer']) if hash['payer']
|
136
136
|
# Parameter is an array, so we need to iterate through it
|
137
137
|
purchase_units = nil
|
@@ -15,7 +15,7 @@ module PaypalServerSdk
|
|
15
15
|
attr_accessor :card
|
16
16
|
|
17
17
|
# The PayPal Wallet response.
|
18
|
-
# @return [
|
18
|
+
# @return [PaypalWalletResponse]
|
19
19
|
attr_accessor :paypal
|
20
20
|
|
21
21
|
# Information needed to pay using ApplePay.
|
@@ -72,7 +72,7 @@ module PaypalServerSdk
|
|
72
72
|
|
73
73
|
# Extract variables from the hash.
|
74
74
|
card = CardResponse.from_hash(hash['card']) if hash['card']
|
75
|
-
paypal =
|
75
|
+
paypal = PaypalWalletResponse.from_hash(hash['paypal']) if hash['paypal']
|
76
76
|
apple_pay = ApplePayPaymentObject.from_hash(hash['apple_pay']) if hash['apple_pay']
|
77
77
|
google_pay = GooglePayWalletResponse.from_hash(hash['google_pay']) if hash['google_pay']
|
78
78
|
venmo = VenmoWalletResponse.from_hash(hash['venmo']) if hash['venmo']
|
@@ -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']
|
@@ -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 Bancontact.
|
@@ -34,11 +34,11 @@ module PaypalServerSdk
|
|
34
34
|
attr_accessor :bancontact
|
35
35
|
|
36
36
|
# Information needed to pay using BLIK.
|
37
|
-
# @return [
|
37
|
+
# @return [BlikPaymentRequest]
|
38
38
|
attr_accessor :blik
|
39
39
|
|
40
40
|
# Information needed to pay using eps.
|
41
|
-
# @return [
|
41
|
+
# @return [EpsPaymentRequest]
|
42
42
|
attr_accessor :eps
|
43
43
|
|
44
44
|
# Information needed to pay using giropay.
|
@@ -46,11 +46,11 @@ module PaypalServerSdk
|
|
46
46
|
attr_accessor :giropay
|
47
47
|
|
48
48
|
# Information needed to pay using iDEAL.
|
49
|
-
# @return [
|
49
|
+
# @return [IdealPaymentRequest]
|
50
50
|
attr_accessor :ideal
|
51
51
|
|
52
52
|
# Information needed to pay using MyBank.
|
53
|
-
# @return [
|
53
|
+
# @return [MybankPaymentRequest]
|
54
54
|
attr_accessor :mybank
|
55
55
|
|
56
56
|
# Information needed to pay using P24 (Przelewy24).
|
@@ -152,13 +152,13 @@ module PaypalServerSdk
|
|
152
152
|
# Extract variables from the hash.
|
153
153
|
card = CardRequest.from_hash(hash['card']) if hash['card']
|
154
154
|
token = Token.from_hash(hash['token']) if hash['token']
|
155
|
-
paypal =
|
155
|
+
paypal = PaypalWallet.from_hash(hash['paypal']) if hash['paypal']
|
156
156
|
bancontact = BancontactPaymentRequest.from_hash(hash['bancontact']) if hash['bancontact']
|
157
|
-
blik =
|
158
|
-
eps =
|
157
|
+
blik = BlikPaymentRequest.from_hash(hash['blik']) if hash['blik']
|
158
|
+
eps = EpsPaymentRequest.from_hash(hash['eps']) if hash['eps']
|
159
159
|
giropay = GiropayPaymentRequest.from_hash(hash['giropay']) if hash['giropay']
|
160
|
-
ideal =
|
161
|
-
mybank =
|
160
|
+
ideal = IdealPaymentRequest.from_hash(hash['ideal']) if hash['ideal']
|
161
|
+
mybank = MybankPaymentRequest.from_hash(hash['mybank']) if hash['mybank']
|
162
162
|
p24 = P24PaymentRequest.from_hash(hash['p24']) if hash['p24']
|
163
163
|
sofort = SofortPaymentRequest.from_hash(hash['sofort']) if hash['sofort']
|
164
164
|
trustly = TrustlyPaymentRequest.from_hash(hash['trustly']) if hash['trustly']
|
@@ -15,7 +15,7 @@ module PaypalServerSdk
|
|
15
15
|
attr_accessor :card
|
16
16
|
|
17
17
|
# The PayPal Wallet response.
|
18
|
-
# @return [
|
18
|
+
# @return [PaypalWalletResponse]
|
19
19
|
attr_accessor :paypal
|
20
20
|
|
21
21
|
# Information used to pay Bancontact.
|
@@ -23,11 +23,11 @@ module PaypalServerSdk
|
|
23
23
|
attr_accessor :bancontact
|
24
24
|
|
25
25
|
# Information used to pay using BLIK.
|
26
|
-
# @return [
|
26
|
+
# @return [BlikPaymentObject]
|
27
27
|
attr_accessor :blik
|
28
28
|
|
29
29
|
# Information used to pay using eps.
|
30
|
-
# @return [
|
30
|
+
# @return [EpsPaymentObject]
|
31
31
|
attr_accessor :eps
|
32
32
|
|
33
33
|
# Information needed to pay using giropay.
|
@@ -35,11 +35,11 @@ module PaypalServerSdk
|
|
35
35
|
attr_accessor :giropay
|
36
36
|
|
37
37
|
# Information used to pay using iDEAL.
|
38
|
-
# @return [
|
38
|
+
# @return [IdealPaymentObject]
|
39
39
|
attr_accessor :ideal
|
40
40
|
|
41
41
|
# Information used to pay using MyBank.
|
42
|
-
# @return [
|
42
|
+
# @return [MybankPaymentObject]
|
43
43
|
attr_accessor :mybank
|
44
44
|
|
45
45
|
# Information used to pay using P24(Przelewy24).
|
@@ -137,13 +137,13 @@ module PaypalServerSdk
|
|
137
137
|
|
138
138
|
# Extract variables from the hash.
|
139
139
|
card = CardResponse.from_hash(hash['card']) if hash['card']
|
140
|
-
paypal =
|
140
|
+
paypal = PaypalWalletResponse.from_hash(hash['paypal']) if hash['paypal']
|
141
141
|
bancontact = BancontactPaymentObject.from_hash(hash['bancontact']) if hash['bancontact']
|
142
|
-
blik =
|
143
|
-
eps =
|
142
|
+
blik = BlikPaymentObject.from_hash(hash['blik']) if hash['blik']
|
143
|
+
eps = EpsPaymentObject.from_hash(hash['eps']) if hash['eps']
|
144
144
|
giropay = GiropayPaymentObject.from_hash(hash['giropay']) if hash['giropay']
|
145
|
-
ideal =
|
146
|
-
mybank =
|
145
|
+
ideal = IdealPaymentObject.from_hash(hash['ideal']) if hash['ideal']
|
146
|
+
mybank = MybankPaymentObject.from_hash(hash['mybank']) if hash['mybank']
|
147
147
|
p24 = P24PaymentObject.from_hash(hash['p24']) if hash['p24']
|
148
148
|
sofort = SofortPaymentObject.from_hash(hash['sofort']) if hash['sofort']
|
149
149
|
trustly = TrustlyPaymentObject.from_hash(hash['trustly']) if hash['trustly']
|
@@ -14,7 +14,7 @@ module PaypalServerSdk
|
|
14
14
|
attr_accessor :card
|
15
15
|
|
16
16
|
# Full representation of a Card Payment Token including network token.
|
17
|
-
# @return [
|
17
|
+
# @return [PaypalPaymentToken]
|
18
18
|
attr_accessor :paypal
|
19
19
|
|
20
20
|
# Full representation of a Card Payment Token including network token.
|
@@ -71,7 +71,7 @@ module PaypalServerSdk
|
|
71
71
|
|
72
72
|
# Extract variables from the hash.
|
73
73
|
card = CardPaymentToken.from_hash(hash['card']) if hash['card']
|
74
|
-
paypal =
|
74
|
+
paypal = PaypalPaymentToken.from_hash(hash['paypal']) if hash['paypal']
|
75
75
|
venmo = VenmoPaymentToken.from_hash(hash['venmo']) if hash['venmo']
|
76
76
|
apple_pay = ApplePayPaymentToken.from_hash(hash['apple_pay']) if hash['apple_pay']
|
77
77
|
bank = hash.key?('bank') ? hash['bank'] : SKIP
|
@@ -5,8 +5,8 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# The type of landing page to show on the PayPal site for customer checkout.
|
8
|
-
class
|
9
|
-
|
8
|
+
class PaypalExperienceLandingPage
|
9
|
+
PAYPAL_EXPERIENCE_LANDING_PAGE = [
|
10
10
|
# TODO: Write general description for LOGIN
|
11
11
|
LOGIN = 'LOGIN'.freeze,
|
12
12
|
|
@@ -6,8 +6,8 @@
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Configures a <strong>Continue</strong> or <strong>Pay Now</strong> checkout
|
8
8
|
# flow.
|
9
|
-
class
|
10
|
-
|
9
|
+
class PaypalExperienceUserAction
|
10
|
+
PAYPAL_EXPERIENCE_USER_ACTION = [
|
11
11
|
# TODO: Write general description for CONTINUE
|
12
12
|
CONTINUE = 'CONTINUE'.freeze,
|
13
13
|
|
@@ -4,8 +4,8 @@
|
|
4
4
|
# ( https://apimatic.io ).
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
|
-
#
|
8
|
-
class
|
7
|
+
# PaypalPaymentToken Model.
|
8
|
+
class PaypalPaymentToken < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -163,7 +163,7 @@ module PaypalServerSdk
|
|
163
163
|
phone_number = Phone.from_hash(hash['phone_number']) if hash['phone_number']
|
164
164
|
|
165
165
|
# Create object from extracted values.
|
166
|
-
|
166
|
+
PaypalPaymentToken.new(description: description,
|
167
167
|
shipping: shipping,
|
168
168
|
permit_multiple_payment_tokens: permit_multiple_payment_tokens,
|
169
169
|
usage_type: usage_type,
|
@@ -7,8 +7,8 @@ module PaypalServerSdk
|
|
7
7
|
# The customer type associated with the PayPal payment token. This is to
|
8
8
|
# indicate whether the customer acting on the merchant / platform is either a
|
9
9
|
# business or a consumer.
|
10
|
-
class
|
11
|
-
|
10
|
+
class PaypalPaymentTokenCustomerType
|
11
|
+
PAYPAL_PAYMENT_TOKEN_CUSTOMER_TYPE = [
|
12
12
|
# TODO: Write general description for CONSUMER
|
13
13
|
CONSUMER = 'CONSUMER'.freeze,
|
14
14
|
|
@@ -5,8 +5,8 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Expected business/pricing model for the billing agreement.
|
8
|
-
class
|
9
|
-
|
8
|
+
class PaypalPaymentTokenUsagePattern
|
9
|
+
PAYPAL_PAYMENT_TOKEN_USAGE_PATTERN = [
|
10
10
|
# TODO: Write general description for IMMEDIATE
|
11
11
|
IMMEDIATE = 'IMMEDIATE'.freeze,
|
12
12
|
|
@@ -5,8 +5,8 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# The usage type associated with the PayPal payment token.
|
8
|
-
class
|
9
|
-
|
8
|
+
class PaypalPaymentTokenUsageType
|
9
|
+
PAYPAL_PAYMENT_TOKEN_USAGE_TYPE = [
|
10
10
|
# TODO: Write general description for MERCHANT
|
11
11
|
MERCHANT = 'MERCHANT'.freeze,
|
12
12
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# A resource that identifies a PayPal Wallet is used for payment.
|
8
|
-
class
|
8
|
+
class PaypalWallet < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -55,7 +55,7 @@ module PaypalServerSdk
|
|
55
55
|
attr_accessor :address
|
56
56
|
|
57
57
|
# Additional attributes associated with the use of this PayPal Wallet.
|
58
|
-
# @return [
|
58
|
+
# @return [PaypalWalletAttributes]
|
59
59
|
attr_accessor :attributes
|
60
60
|
|
61
61
|
# Customizes the payer experience during the approval process for payment
|
@@ -63,7 +63,7 @@ module PaypalServerSdk
|
|
63
63
|
# might configure <code>brand_name</code> and
|
64
64
|
# <code>shipping_preference</code> during partner account setup, which
|
65
65
|
# overrides the request values.</blockquote>
|
66
|
-
# @return [
|
66
|
+
# @return [PaypalWalletExperienceContext]
|
67
67
|
attr_accessor :experience_context
|
68
68
|
|
69
69
|
# The PayPal billing agreement ID. References an approved recurring payment
|
@@ -136,14 +136,14 @@ module PaypalServerSdk
|
|
136
136
|
birth_date = hash.key?('birth_date') ? hash['birth_date'] : SKIP
|
137
137
|
tax_info = TaxInfo.from_hash(hash['tax_info']) if hash['tax_info']
|
138
138
|
address = Address.from_hash(hash['address']) if hash['address']
|
139
|
-
attributes =
|
140
|
-
experience_context =
|
139
|
+
attributes = PaypalWalletAttributes.from_hash(hash['attributes']) if hash['attributes']
|
140
|
+
experience_context = PaypalWalletExperienceContext.from_hash(hash['experience_context']) if
|
141
141
|
hash['experience_context']
|
142
142
|
billing_agreement_id =
|
143
143
|
hash.key?('billing_agreement_id') ? hash['billing_agreement_id'] : SKIP
|
144
144
|
|
145
145
|
# Create object from extracted values.
|
146
|
-
|
146
|
+
PaypalWallet.new(vault_id: vault_id,
|
147
147
|
email_address: email_address,
|
148
148
|
name: name,
|
149
149
|
phone: phone,
|
@@ -6,8 +6,8 @@
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# The account status indicates whether the buyer has verified the financial
|
8
8
|
# details associated with their PayPal account.
|
9
|
-
class
|
10
|
-
|
9
|
+
class PaypalWalletAccountVerificationStatus
|
10
|
+
PAYPAL_WALLET_ACCOUNT_VERIFICATION_STATUS = [
|
11
11
|
# TODO: Write general description for VERIFIED
|
12
12
|
VERIFIED = 'VERIFIED'.freeze,
|
13
13
|
|
data/lib/paypal_server_sdk/models/{pay_pal_wallet_attributes.rb → paypal_wallet_attributes.rb}
RENAMED
@@ -5,16 +5,16 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Additional attributes associated with the use of this PayPal Wallet.
|
8
|
-
class
|
8
|
+
class PaypalWalletAttributes < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
12
12
|
# TODO: Write general description for this method
|
13
|
-
# @return [
|
13
|
+
# @return [PaypalWalletCustomerRequest]
|
14
14
|
attr_accessor :customer
|
15
15
|
|
16
16
|
# TODO: Write general description for this method
|
17
|
-
# @return [
|
17
|
+
# @return [PaypalWalletVaultInstruction]
|
18
18
|
attr_accessor :vault
|
19
19
|
|
20
20
|
# A mapping from model property names to API property names.
|
@@ -48,11 +48,11 @@ module PaypalServerSdk
|
|
48
48
|
return nil unless hash
|
49
49
|
|
50
50
|
# Extract variables from the hash.
|
51
|
-
customer =
|
52
|
-
vault =
|
51
|
+
customer = PaypalWalletCustomerRequest.from_hash(hash['customer']) if hash['customer']
|
52
|
+
vault = PaypalWalletVaultInstruction.from_hash(hash['vault']) if hash['vault']
|
53
53
|
|
54
54
|
# Create object from extracted values.
|
55
|
-
|
55
|
+
PaypalWalletAttributes.new(customer: customer,
|
56
56
|
vault: vault)
|
57
57
|
end
|
58
58
|
end
|
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# Additional attributes associated with the use of a PayPal Wallet.
|
8
|
-
class
|
8
|
+
class PaypalWalletAttributesResponse < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
12
12
|
# The details about a saved PayPal Wallet payment source.
|
13
|
-
# @return [
|
13
|
+
# @return [PaypalWalletVaultResponse]
|
14
14
|
attr_accessor :vault
|
15
15
|
|
16
16
|
# An array of merchant cobranded cards used by buyer to complete an order.
|
@@ -50,7 +50,7 @@ module PaypalServerSdk
|
|
50
50
|
return nil unless hash
|
51
51
|
|
52
52
|
# Extract variables from the hash.
|
53
|
-
vault =
|
53
|
+
vault = PaypalWalletVaultResponse.from_hash(hash['vault']) if hash['vault']
|
54
54
|
# Parameter is an array, so we need to iterate through it
|
55
55
|
cobranded_cards = nil
|
56
56
|
unless hash['cobranded_cards'].nil?
|
@@ -63,7 +63,7 @@ module PaypalServerSdk
|
|
63
63
|
cobranded_cards = SKIP unless hash.key?('cobranded_cards')
|
64
64
|
|
65
65
|
# Create object from extracted values.
|
66
|
-
|
66
|
+
PaypalWalletAttributesResponse.new(vault: vault,
|
67
67
|
cobranded_cards: cobranded_cards)
|
68
68
|
end
|
69
69
|
end
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# The details about a customer in PayPal's system of record.
|
8
|
-
class
|
8
|
+
class PaypalWalletCustomer < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -76,7 +76,7 @@ module PaypalServerSdk
|
|
76
76
|
hash.key?('merchant_customer_id') ? hash['merchant_customer_id'] : SKIP
|
77
77
|
|
78
78
|
# Create object from extracted values.
|
79
|
-
|
79
|
+
PaypalWalletCustomer.new(id: id,
|
80
80
|
email_address: email_address,
|
81
81
|
phone: phone,
|
82
82
|
merchant_customer_id: merchant_customer_id)
|
@@ -4,8 +4,8 @@
|
|
4
4
|
# ( https://apimatic.io ).
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
|
-
#
|
8
|
-
class
|
7
|
+
# PaypalWalletCustomerRequest Model.
|
8
|
+
class PaypalWalletCustomerRequest < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -76,7 +76,7 @@ module PaypalServerSdk
|
|
76
76
|
hash.key?('merchant_customer_id') ? hash['merchant_customer_id'] : SKIP
|
77
77
|
|
78
78
|
# Create object from extracted values.
|
79
|
-
|
79
|
+
PaypalWalletCustomerRequest.new(id: id,
|
80
80
|
email_address: email_address,
|
81
81
|
phone: phone,
|
82
82
|
merchant_customer_id: merchant_customer_id)
|
@@ -9,7 +9,7 @@ module PaypalServerSdk
|
|
9
9
|
# configure <code>brand_name</code> and <code>shipping_preference</code>
|
10
10
|
# during partner account setup, which overrides the request
|
11
11
|
# values.</blockquote>
|
12
|
-
class
|
12
|
+
class PaypalWalletExperienceContext < BaseModel
|
13
13
|
SKIP = Object.new
|
14
14
|
private_constant :SKIP
|
15
15
|
|
@@ -43,12 +43,12 @@ module PaypalServerSdk
|
|
43
43
|
attr_accessor :cancel_url
|
44
44
|
|
45
45
|
# The type of landing page to show on the PayPal site for customer checkout.
|
46
|
-
# @return [
|
46
|
+
# @return [PaypalExperienceLandingPage]
|
47
47
|
attr_accessor :landing_page
|
48
48
|
|
49
49
|
# Configures a <strong>Continue</strong> or <strong>Pay Now</strong>
|
50
50
|
# checkout flow.
|
51
|
-
# @return [
|
51
|
+
# @return [PaypalExperienceUserAction]
|
52
52
|
attr_accessor :user_action
|
53
53
|
|
54
54
|
# The merchant-preferred payment methods.
|
@@ -92,8 +92,8 @@ module PaypalServerSdk
|
|
92
92
|
brand_name: SKIP, locale: SKIP,
|
93
93
|
shipping_preference: ShippingPreference::GET_FROM_FILE, return_url: SKIP,
|
94
94
|
cancel_url: SKIP,
|
95
|
-
landing_page:
|
96
|
-
user_action:
|
95
|
+
landing_page: PaypalExperienceLandingPage::NO_PREFERENCE,
|
96
|
+
user_action: PaypalExperienceUserAction::CONTINUE,
|
97
97
|
payment_method_preference: PayeePaymentMethodPreference::UNRESTRICTED
|
98
98
|
)
|
99
99
|
@brand_name = brand_name unless brand_name == SKIP
|
@@ -121,13 +121,13 @@ module PaypalServerSdk
|
|
121
121
|
return_url = hash.key?('return_url') ? hash['return_url'] : SKIP
|
122
122
|
cancel_url = hash.key?('cancel_url') ? hash['cancel_url'] : SKIP
|
123
123
|
landing_page =
|
124
|
-
hash['landing_page'] ||=
|
125
|
-
user_action = hash['user_action'] ||=
|
124
|
+
hash['landing_page'] ||= PaypalExperienceLandingPage::NO_PREFERENCE
|
125
|
+
user_action = hash['user_action'] ||= PaypalExperienceUserAction::CONTINUE
|
126
126
|
payment_method_preference =
|
127
127
|
hash['payment_method_preference'] ||= PayeePaymentMethodPreference::UNRESTRICTED
|
128
128
|
|
129
129
|
# Create object from extracted values.
|
130
|
-
|
130
|
+
PaypalWalletExperienceContext.new(brand_name: brand_name,
|
131
131
|
locale: locale,
|
132
132
|
shipping_preference: shipping_preference,
|
133
133
|
return_url: return_url,
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
7
|
# The PayPal Wallet response.
|
8
|
-
class
|
8
|
+
class PaypalWalletResponse < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -26,7 +26,7 @@ module PaypalServerSdk
|
|
26
26
|
|
27
27
|
# The account status indicates whether the buyer has verified the financial
|
28
28
|
# details associated with their PayPal account.
|
29
|
-
# @return [
|
29
|
+
# @return [PaypalWalletAccountVerificationStatus]
|
30
30
|
attr_accessor :account_status
|
31
31
|
|
32
32
|
# The name of the party.
|
@@ -71,7 +71,7 @@ module PaypalServerSdk
|
|
71
71
|
attr_accessor :address
|
72
72
|
|
73
73
|
# Additional attributes associated with the use of a PayPal Wallet.
|
74
|
-
# @return [
|
74
|
+
# @return [PaypalWalletAttributesResponse]
|
75
75
|
attr_accessor :attributes
|
76
76
|
|
77
77
|
# A mapping from model property names to API property names.
|
@@ -146,11 +146,11 @@ module PaypalServerSdk
|
|
146
146
|
business_name = hash.key?('business_name') ? hash['business_name'] : SKIP
|
147
147
|
tax_info = TaxInfo.from_hash(hash['tax_info']) if hash['tax_info']
|
148
148
|
address = Address.from_hash(hash['address']) if hash['address']
|
149
|
-
attributes =
|
149
|
+
attributes = PaypalWalletAttributesResponse.from_hash(hash['attributes']) if
|
150
150
|
hash['attributes']
|
151
151
|
|
152
152
|
# Create object from extracted values.
|
153
|
-
|
153
|
+
PaypalWalletResponse.new(email_address: email_address,
|
154
154
|
account_id: account_id,
|
155
155
|
account_status: account_status,
|
156
156
|
name: name,
|
@@ -4,8 +4,8 @@
|
|
4
4
|
# ( https://apimatic.io ).
|
5
5
|
|
6
6
|
module PaypalServerSdk
|
7
|
-
#
|
8
|
-
class
|
7
|
+
# PaypalWalletVaultInstruction Model.
|
8
|
+
class PaypalWalletVaultInstruction < BaseModel
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
@@ -20,17 +20,17 @@ module PaypalServerSdk
|
|
20
20
|
attr_accessor :description
|
21
21
|
|
22
22
|
# Expected business/pricing model for the billing agreement.
|
23
|
-
# @return [
|
23
|
+
# @return [PaypalPaymentTokenUsagePattern]
|
24
24
|
attr_accessor :usage_pattern
|
25
25
|
|
26
26
|
# The usage type associated with the PayPal payment token.
|
27
|
-
# @return [
|
27
|
+
# @return [PaypalPaymentTokenUsageType]
|
28
28
|
attr_accessor :usage_type
|
29
29
|
|
30
30
|
# The customer type associated with the PayPal payment token. This is to
|
31
31
|
# indicate whether the customer acting on the merchant / platform is either
|
32
32
|
# a business or a consumer.
|
33
|
-
# @return [
|
33
|
+
# @return [PaypalPaymentTokenCustomerType]
|
34
34
|
attr_accessor :customer_type
|
35
35
|
|
36
36
|
# Create multiple payment tokens for the same payer, merchant/platform
|
@@ -75,7 +75,7 @@ module PaypalServerSdk
|
|
75
75
|
|
76
76
|
def initialize(usage_type:, store_in_vault: SKIP, description: SKIP,
|
77
77
|
usage_pattern: SKIP,
|
78
|
-
customer_type:
|
78
|
+
customer_type: PaypalPaymentTokenCustomerType::CONSUMER,
|
79
79
|
permit_multiple_payment_tokens: false)
|
80
80
|
@store_in_vault = store_in_vault unless store_in_vault == SKIP
|
81
81
|
@description = description unless description == SKIP
|
@@ -99,12 +99,12 @@ module PaypalServerSdk
|
|
99
99
|
description = hash.key?('description') ? hash['description'] : SKIP
|
100
100
|
usage_pattern = hash.key?('usage_pattern') ? hash['usage_pattern'] : SKIP
|
101
101
|
customer_type =
|
102
|
-
hash['customer_type'] ||=
|
102
|
+
hash['customer_type'] ||= PaypalPaymentTokenCustomerType::CONSUMER
|
103
103
|
permit_multiple_payment_tokens =
|
104
104
|
hash['permit_multiple_payment_tokens'] ||= false
|
105
105
|
|
106
106
|
# Create object from extracted values.
|
107
|
-
|
107
|
+
PaypalWalletVaultInstruction.new(usage_type: usage_type,
|
108
108
|
store_in_vault: store_in_vault,
|
109
109
|
description: description,
|
110
110
|
usage_pattern: usage_pattern,
|