Skip to content

Commit f07d0bc

Browse files
committed
add initializer with default nil for customer
1 parent dc0c32e commit f07d0bc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Demo/Demo/Models/CreateOrderParams.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ struct Attributes: Encodable {
6363

6464
let vault: Vault
6565
let customer: VaultCustomer?
66+
67+
init(vault: Vault, customer: VaultCustomer? = nil) {
68+
self.vault = vault
69+
self.customer = customer
70+
}
6671
}
6772

6873
struct Vault: Encodable {

Demo/Demo/ViewModels/PayPalWebViewModel.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ class PayPalWebViewModel: ObservableObject, PayPalWebCheckoutDelegate {
2828
storeInVault: "ON_SUCCESS",
2929
usageType: "MERCHANT",
3030
customerType: "CONSUMER"
31-
),
32-
customer: nil as VaultCustomer?
31+
)
3332
)
3433
let paypal = VaultPayPal(attributes: attributes, experienceContext: ExperienceContext(returnURL: "https://example.com/returnUrl", cancelURL: "https://example.com/cancelUrl"))
3534
vaultPayPalPaymentSource = VaultPayPalPaymentSource(paypal: paypal)

0 commit comments

Comments
 (0)