@@ -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 ,
@@ -39,7 +39,11 @@ final class PaymentCaptureOrchestrator {
3939 DDLogWarn ( " Warning: failed to fetch customer ID for an order " )
4040 }
4141
42- guard let parameters = paymentParameters ( order: order, account: paymentsAccount, customerID: customerID) else {
42+ guard let parameters = paymentParameters (
43+ order: order,
44+ statementDescriptor: statementDescriptor,
45+ customerID: customerID
46+ ) else {
4347 DDLogError ( " Error: failed to create payment parameters for an order " )
4448 onCompletion ( . failure( CardReaderServiceError . paymentCapture ( ) ) )
4549 return
@@ -212,7 +216,7 @@ private extension PaymentCaptureOrchestrator {
212216 ServiceLocator . stores. dispatch ( action)
213217 }
214218
215- func paymentParameters( order: Order , account : PaymentGatewayAccount ? , customerID: String ? ) -> PaymentParameters ? {
219+ func paymentParameters( order: Order , statementDescriptor : String ? , customerID: String ? ) -> PaymentParameters ? {
216220 guard let orderTotal = currencyFormatter. convertToDecimal ( from: order. total) else {
217221 DDLogError ( " Error: attempted to collect payment for an order without a valid total. " )
218222 return nil
@@ -244,7 +248,7 @@ private extension PaymentCaptureOrchestrator {
244248 return PaymentParameters ( amount: orderTotal as Decimal ,
245249 currency: order. currency,
246250 receiptDescription: receiptDescription ( orderNumber: order. number) ,
247- statementDescription: account ? . statementDescriptor,
251+ statementDescription: statementDescriptor,
248252 receiptEmail: order. billingAddress? . email,
249253 metadata: metadata,
250254 customerID: customerID)
0 commit comments