Skip to content

Commit

Permalink
Merge pull request #12 in MI/yandex-checkout-payments-swift from rele…
Browse files Browse the repository at this point in the history
…ase/2.0.5-apple-pay to master

* commit '26de420657c9b8e988a6555bc234e5fc1a3bbe3d':
  [NO-TASK] Fix changelog
  [BIOS-936] Add purchase description to ApplePay
  • Loading branch information
oltv00 committed Apr 18, 2019
2 parents 89c1987 + 26de420 commit 33fba4a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

### 2.0.5

1. Теперь на контракте Apple Pay показывается описание товара.

### 2.0.4

1. Починили серый фон при оплате Apple Pay в некоторых случаях.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ struct ApplePayModuleInputData {
let merchantIdentifier: String?
let amount: Amount
let shopName: String
let purchaseDescription: String
let supportedNetworks: [PKPaymentNetwork]
}

Expand All @@ -27,8 +28,9 @@ enum ApplePayAssembly {
paymentRequest.merchantCapabilities = .capability3DS

let amountValue = inputData.amount.value as NSDecimalNumber
let amount = PKPaymentSummaryItem(label: inputData.shopName, amount: amountValue)
paymentRequest.paymentSummaryItems = [amount]
let shopNameAmount = PKPaymentSummaryItem(label: inputData.shopName, amount: amountValue)
let purchaseDescriptionAmount = PKPaymentSummaryItem(label: inputData.purchaseDescription, amount: amountValue)
paymentRequest.paymentSummaryItems = [purchaseDescriptionAmount, shopNameAmount]

let authorizationViewController = PKPaymentAuthorizationViewController(paymentRequest: paymentRequest)
authorizationViewController?.delegate = moduleOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ extension TokenizationPresenter: TokenizationStrategyOutput {
let moduleInputData = ApplePayModuleInputData(merchantIdentifier: inputData.applePayMerchantIdentifier,
amount: inputData.amount,
shopName: inputData.shopName,
purchaseDescription: inputData.purchaseDescription,
supportedNetworks: ApplePayConstants.paymentNetworks)
DispatchQueue.main.async { [weak self] in
guard let strongSelf = self else { return }
Expand Down

0 comments on commit 33fba4a

Please sign in to comment.