【发布时间】:2013-07-15 11:11:19
【问题描述】:
大家好,我遇到了一个问题,那就是 paypal 代表 -
(void)paymentSuccessWithKey:(NSString *)payKey andStatus:(PayPalPaymentStatus)paymentStatus {
事务成功并结束时永远不会调用。这是我的代码
- (void)viewDidLoad
{
[super viewDidLoad];
[PayPal initializeWithAppID:kPayPalAPI
forEnvironment:ENV_SANDBOX];
// Do any additional setup after loading the view from its nib.
}
-(IBAction)payWithPayPal{
PayPalPayment *payment = [[[PayPalPayment alloc] init] autorelease];
payment.recipient = @"xxxx@mail.com";
payment.paymentCurrency = @"EUR";
payment.description =[NSString stringWithFormat:@"test tetst %@",stest];
payment.merchantName = @"Test product";
//subtotal of all items, without tax and shipping
payment.subTotal = [NSDecimalNumber decimalNumberWithString:txtMontant.text];
PayPalInvoiceItem *item = [[[PayPalInvoiceItem alloc] init] autorelease];
item.totalPrice = payment.subTotal;
item.name = @"Test";
[payment.invoiceData.invoiceItems addObject:item];
[[PayPal getPayPalInst] checkoutWithPayment:payment];
}
我已经设置了这样的委托 ViewController : UIViewController<UITextFieldDelegate,PayPalPaymentDelegate> 。有什么我想念的吗?
【问题讨论】:
-
你在 iOS 6 中使用它吗
-
此方法在 iOS 6 中不起作用,请检查其他方法
-
哪种方法:- (void)paymentSuccessWithKey:(NSString *)payKey andStatus:(PayPalPaymentStatus)paymentStatus { ?
-
是的,伙计:)这个方法
-
问题是我必须使用提供的按钮。它在初始化完成后启用。感谢您的时间和帮助@Divz
标签: iphone ios paypal paypal-sandbox