我正在实现自定义Stripe SDK,作为测试,我有一个名为pay的方法:
-(void)pay{
STPCardParams *cardParams = [[STPCardParams alloc] init];
cardParams.number = @"4242424242424242";
cardParams.expMonth = 10;
cardParams.expYear = 2018;
cardParams.cvc = @"123";
[[STPAPIClient sharedClient] createTokenWithCard:cardParams completion:^(STPToken *token, NSError *error) {
if (error) {
// show the error, maybe by presenting an alert to the user
} else {
[self submitTokenToBackend:token completion:^(NSError *error) {
if (error) {
// show the error
} else {
//[self showReceiptPage];
}
}];
}
}];
}
我将创建后端脚本来收费,但我的问题实际上只是创建了要接收的方法:submitTokenToBackend:token completion:^(NSError *error)
我试过了:
-(void)submitTokenToBackend:(STPToken *)token: (NSError*) error{
但是这不起作用......任何想法我将如何制作这种方法?