gpt4 book ai didi

iOS:逐步集成 PayPal braintree

转载 作者:太空宇宙 更新时间:2023-11-03 16:23:03 27 4
gpt4 key购买 nike

在我的申请中,我需要提供客户应使用信用卡付款。 Paypal 移动 SDK 不支持。

所以我需要集成 Brain tree,但我找不到合适的步骤来集成它。

任何人都可以帮助我将 paypal braintree 集成到我的应用程序中。

最佳答案

在下面搜索文档以获取更多详细信息!!

https://developers.braintreepayments.com/guides/paypal/client-side/ios/v4

#import "BraintreePayPal.h"

- (void)viewDidLoad {
[super viewDidLoad];

self.braintreeClient = [[BTAPIClient alloc] initWithAuthorization:@"<#CLIENT_AUTHORIZATION#>"];

UIButton *customPayPalButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 60, 120)];
[customPayPalButton addTarget:self
action:@selector(customPayPalButtonTapped:)
forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:customPayPalButton];
}


- (IBAction)customPayPalButtonTapped:(id)sender {
BTPayPalDriver *payPalDriver = [[BTPayPalDriver alloc] initWithAPIClient:self.braintreeClient];
payPalDriver.viewControllerPresentingDelegate = self;
payPalDriver.appSwitchDelegate = self; // Optional

// Start the Vault flow, or...
[payPalDriver authorizeAccountWithCompletion:^(BTPayPalAccountNonce *tokenizedPayPalAccount, NSError *error) {
...
}];

// ...start the Checkout flow
BTPayPalRequest *request = [[BTPayPalRequest alloc] initWithAmount:@"1.00"]; //Here you need to enter the amount
[payPalDriver requestOneTimePayment:request
completion:^(BTPayPalAccountNonce *tokenizedPayPalAccount, NSError *error) {
...
}];
}

关于iOS:逐步集成 PayPal braintree,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45252058/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com