我无法让这个工作,所有的示例代码似乎都已被弃用。我已经能够更新很多常量,但有没有人有任何样本。我有一个沙盒应用程序 ID。到目前为止,我已经添加了库:
@interface PaymentViewController ()
@property (weak, nonatomic) IBOutlet UIButton *paypalButton;
@end
- (void)viewDidLoad {
[super viewDidLoad];
// 1. spawn a new thread to initialize the paypal library
// TODO: spawn a new thread
[PayPal initializeWithAppID:SANDBOX_APP_ID forEnvironment:ENV_SANDBOX];
// 2. generate the 'pay with paypal' button
self.paypalButton = [[PayPal getInstance] getPayButtonWithTarget:self
andAction:@selector(payWithPayPal)
andButtonType:BUTTON_278x43
andButtonText:BUTTON_TEXT_PAY];
}
// 3. add the payment details
// 4. wait for callback