我在支付时使用PayPal SDK支付网关我想获得用户名字,姓氏电子邮件和地址所以,我从PayPal Docs找到了这个网址
https://developer.paypal.com/docs/api/payments/#payment_execute获取用户详细信息
代码:
- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController didCompletePayment:(PayPalPayment *)completedPayment {
NSLog(@"PayPal Payment Success!");
[self sendCompletedPaymentToServer:completedPayment]; // Payment was processed successfully; send to server for verification and fulfillment
[self dismissViewControllerAnimated:YES completion:nil];
}
#pragma mark Proof of payment validation
- (void)sendCompletedPaymentToServer:(PayPalPayment *)completedPayment {
// TODO: Send completedPayment.confirmation to server
NSLog(@"Here is your proof of payment:\n\n%@\n\nSend this to your server for confirmation and fulfillment.", completedPayment.description);
NSLog(@"Details %@",completedPayment.paymentDetails);
NSLog(@"Details 2 %@",completedPayment.confirmation);
}
- (void)payPalPaymentDidCancel:(PayPalPaymentViewController *)paymentViewController {
NSLog(@"PayPal Payment Canceled");
[self dismissViewControllerAnimated:YES completion:nil];
}