如何使用 iOS 中的平衡支付将 href 发送到服务器以进行支付处理

how to send href to sever for payment processing using balanced payments in iOS

我正在使用平衡支付(1.1 版)使用信用卡支付。

我已经按照 https://github.com/balanced/balanced-ios

给出的示例进行操作

我能够从

获取 href
[balanced createCardWithNumber:[tfCardNumber text]
               expirationMonth:[[tfExpMonth text] integerValue]
                expirationYear:[[tfExpYear text] integerValue]
                     onSuccess:^(NSDictionary *responseParams) {
                         response = responseParams;
                         [tvResponseView setText:[response description]];
                         NSLog(@"%@", response);

                         [self setActivityIndicatorEnabled:NO];
                         [self setResetButton];
                         tvResponseView.alpha = 0.0;
                         [UIView animateWithDuration:0.5 animations:^{
                             [tvResponseView setHidden:NO];
                             tvResponseView.alpha = 1.0;
                         }];
                     }
                       onError:^(NSError *error) {
                           [tvResponseView setText:[response description]];
                           NSLog(@"%@", [error description]);

                           [self setActivityIndicatorEnabled:NO];
                           [self setResetButton];
                       }
                optionalFields:optionalFields];

我想知道如何发送href到服务器,支付流程是怎样的。

任何帮助或建议继续进行。

您使用的库仅用于标记信用卡。它会生成您需要进行收费的令牌 (href)。

您需要在后端执行此操作。你不应该直接在你的应用程序中进行收费,因为你需要从那里发送凭据并且它可能会被拦截。

Balanced 具有 C#、PHP、Node.js、Python、Ruby 和 Java 的库。您还可以发出 CURL 请求 https://docs.balancedpayments.com/1.1/api/cards/#charge-a-card