Skip to content

Commit

Permalink
Tweaking customize-payment request parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
alleus committed Nov 14, 2024
1 parent 9ff6eb7 commit ce345ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SwedbankPaySDK/Classes/Api/SwedbankPayAPIEnpointRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,16 @@ struct SwedbankPayAPIEnpointRouter: EndpointRouterProtocol {
case .customizePayment(let instrument, let paymentMethod, let restrictToPaymentMethods):

switch (instrument, paymentMethod, restrictToPaymentMethods) {
case (nil, nil, let restrictToPaymentMethods):
case (nil, nil, let restrictToPaymentMethods?):
return ["paymentMethod": nil,
"restrictToPaymentMethods": restrictToPaymentMethods]
"restrictToPaymentMethods": restrictToPaymentMethods.isEmpty ? nil : restrictToPaymentMethods]
case (.newCreditCard(let enabledPaymentDetailsConsentCheckbox), _, _):
return ["paymentMethod": "CreditCard",
"restrictToPaymentMethods": nil,
"hideStoredPaymentOptions": true,
"showConsentAffirmation" : enabledPaymentDetailsConsentCheckbox,
]
case (nil, let paymentMethod, nil):
case (nil, let paymentMethod?, nil):
return ["paymentMethod": paymentMethod,
"restrictToPaymentMethods": nil]
case (let instrument?, nil, nil):
Expand Down

0 comments on commit ce345ab

Please sign in to comment.