Skip to content

Commit 1ba1b7c

Browse files
committed
Merge branch 'feature/added-charity' into 'feature/native-payments'
Added a Apple Pay Charity button See merge request swedbank-pay/swedbank-pay-example-app-ios!10
2 parents a67f5f5 + a553020 commit 1ba1b7c

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

Example-app/Example-app.entitlements

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<key>com.apple.developer.in-app-payments</key>
1313
<array>
1414
<string>merchant.com.swedbankpay.exampleapp</string>
15+
<string>merchant.com.swedbankpay.charity</string>
1516
</array>
1617
</dict>
1718
</plist>

Example-app/Views/StandaloneUrlView.swift

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,11 +428,34 @@ struct StandaloneUrlView: View {
428428
viewModel.isLoadingNativePayment = true
429429
viewModel.nativePayment?.makeNativePaymentAttempt(instrument: .applePay(merchantIdentifier: "merchant.com.swedbankpay.exampleapp"))
430430
} label: {
431-
Text("stand_alone_url_payment_apple_pay")
432-
.smallFont()
433-
.frame(maxWidth: .infinity)
434-
.frame(height: 48)
435-
.accessibilityIdentifier("applePayButton")
431+
VStack(spacing: 0) {
432+
Text("stand_alone_url_payment_apple_pay")
433+
Text("merchant.com.swedbankpay.exampleapp")
434+
}
435+
.smallFont()
436+
.frame(maxWidth: .infinity)
437+
.frame(height: 48)
438+
.accessibilityIdentifier("applePayExampleAppButton")
439+
}
440+
.foregroundColor(.white)
441+
.background(.black)
442+
.cornerRadius(30)
443+
.padding(.top, 10)
444+
445+
Button {
446+
isFocused = false
447+
448+
viewModel.isLoadingNativePayment = true
449+
viewModel.nativePayment?.makeNativePaymentAttempt(instrument: .applePay(merchantIdentifier: "merchant.com.swedbankpay.charity"))
450+
} label: {
451+
VStack(spacing: 0) {
452+
Text("stand_alone_url_payment_apple_pay")
453+
Text("merchant.com.swedbankpay.charity")
454+
}
455+
.smallFont()
456+
.frame(maxWidth: .infinity)
457+
.frame(height: 48)
458+
.accessibilityIdentifier("applePayCharityButton")
436459
}
437460
.foregroundColor(.white)
438461
.background(.black)

0 commit comments

Comments
 (0)