@@ -15,7 +15,7 @@ final class PaymentCaptureOrchestrator {
1515 private var walletSuppressionRequestToken : PKSuppressionRequestToken ?
1616
1717 func collectPayment( for order: Order ,
18- paymentsAccount : PaymentGatewayAccount ? ,
18+ statementDescriptor : String ? ,
1919 onPresentMessage: @escaping ( String ) -> Void ,
2020 onClearMessage: @escaping ( ) -> Void ,
2121 onProcessingMessage: @escaping ( ) -> Void ,
@@ -32,7 +32,11 @@ final class PaymentCaptureOrchestrator {
3232 DDLogWarn ( " Warning: failed to fetch customer ID for an order " )
3333 }
3434
35- guard let parameters = paymentParameters ( order: order, account: paymentsAccount, customerID: customerID) else {
35+ guard let parameters = paymentParameters (
36+ order: order,
37+ statementDescriptor: statementDescriptor,
38+ customerID: customerID
39+ ) else {
3640 DDLogError ( " Error: failed to create payment parameters for an order " )
3741 onCompletion ( . failure( CardReaderServiceError . paymentCapture ( ) ) )
3842 return
@@ -205,7 +209,7 @@ private extension PaymentCaptureOrchestrator {
205209 ServiceLocator . stores. dispatch ( action)
206210 }
207211
208- func paymentParameters( order: Order , account : PaymentGatewayAccount ? , customerID: String ? ) -> PaymentParameters ? {
212+ func paymentParameters( order: Order , statementDescriptor : String ? , customerID: String ? ) -> PaymentParameters ? {
209213 guard let orderTotal = currencyFormatter. convertToDecimal ( from: order. total) else {
210214 DDLogError ( " Error: attempted to collect payment for an order without a valid total. " )
211215 return nil
@@ -237,7 +241,7 @@ private extension PaymentCaptureOrchestrator {
237241 return PaymentParameters ( amount: orderTotal as Decimal ,
238242 currency: order. currency,
239243 receiptDescription: receiptDescription ( orderNumber: order. number) ,
240- statementDescription: account ? . statementDescriptor,
244+ statementDescription: statementDescriptor,
241245 receiptEmail: order. billingAddress? . email,
242246 metadata: metadata,
243247 customerID: customerID)
0 commit comments