@@ -90,6 +90,7 @@ class BraintreeCreditCardRequest {
90
90
required this .expirationMonth,
91
91
required this .expirationYear,
92
92
required this .cvv,
93
+ this .cardholderName,
93
94
});
94
95
95
96
/// Number shown on the credit card.
@@ -104,11 +105,15 @@ class BraintreeCreditCardRequest {
104
105
/// A 3 or 4 digit card verification value assigned to credit cards.
105
106
String cvv;
106
107
108
+ /// Cardholder name
109
+ String ? cardholderName;
110
+
107
111
Map <String , dynamic > toJson () => {
108
112
'cardNumber' : cardNumber,
109
113
'expirationMonth' : expirationMonth,
110
114
'expirationYear' : expirationYear,
111
115
'cvv' : cvv,
116
+ 'cardholderName' : cardholderName
112
117
};
113
118
}
114
119
@@ -147,6 +152,8 @@ class BraintreePayPalRequest {
147
152
this .currencyCode,
148
153
this .displayName,
149
154
this .billingAgreementDescription,
155
+ this .payPalPaymentIntent,
156
+ this .payPalPaymentUserAction,
150
157
});
151
158
152
159
/// Amount of the transaction. If [amount] is `null` , PayPal will use the billing agreement (Vault) flow.
@@ -162,16 +169,59 @@ class BraintreePayPalRequest {
162
169
/// Description for the billing agreement for the Vault flow.
163
170
String ? billingAgreementDescription;
164
171
172
+ /// PayPalPaymentIntent. Options are INTENT_AUTHORIZE,INTENT_SALE,INTENT_ORDER
173
+ PayPalPaymentIntent ? payPalPaymentIntent;
174
+
175
+ ///PayPalPaymentUserAction. Options are USER_ACTION_DEFAULT, USER_ACTION_COMMIT
176
+ PayPalPaymentUserAction ? payPalPaymentUserAction;
177
+
165
178
/// Converts this request object into a JSON-encodable format.
166
179
Map <String , dynamic > toJson () => {
167
180
if (amount != null ) 'amount' : amount,
168
181
if (currencyCode != null ) 'currencyCode' : currencyCode,
169
182
if (displayName != null ) 'displayName' : displayName,
170
183
if (billingAgreementDescription != null )
171
184
'billingAgreementDescription' : billingAgreementDescription,
185
+ 'payPalPaymentIntent' : payPalPaymentIntent == null
186
+ ? PayPalPaymentIntent .INTENT_AUTHORIZE .rawValue
187
+ : payPalPaymentIntent? .rawValue,
188
+ if (payPalPaymentUserAction != null )
189
+ 'payPalPaymentUserAction' : payPalPaymentUserAction? .rawValue,
172
190
};
173
191
}
174
192
193
+ enum PayPalPaymentUserAction { USER_ACTION_DEFAULT , USER_ACTION_COMMIT }
194
+
195
+ extension PayPalPaymentUserActionExtension on PayPalPaymentUserAction {
196
+ String ? get rawValue {
197
+ switch (this ) {
198
+ case PayPalPaymentUserAction .USER_ACTION_DEFAULT :
199
+ return '' ;
200
+ case PayPalPaymentUserAction .USER_ACTION_COMMIT :
201
+ return 'commit' ;
202
+ default :
203
+ return null ;
204
+ }
205
+ }
206
+ }
207
+
208
+ enum PayPalPaymentIntent { INTENT_ORDER , INTENT_SALE , INTENT_AUTHORIZE }
209
+
210
+ extension PayPalPaymentIntentExtension on PayPalPaymentIntent {
211
+ String ? get rawValue {
212
+ switch (this ) {
213
+ case PayPalPaymentIntent .INTENT_AUTHORIZE :
214
+ return 'authorize' ;
215
+ case PayPalPaymentIntent .INTENT_SALE :
216
+ return 'sale' ;
217
+ case PayPalPaymentIntent .INTENT_ORDER :
218
+ return 'order' ;
219
+ default :
220
+ return null ;
221
+ }
222
+ }
223
+ }
224
+
175
225
enum ApplePaySummaryItemType {
176
226
Final ,
177
227
Pending ,
0 commit comments