如何在iOS交易后获得PayPal中的收款人详细信息?

时间:2016-09-01 12:43:50

标签: ios objective-c paypal paypal-sandbox paypal-rest-sdk

我在支付时使用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];
}

0 个答案:

没有答案