iphone - 如何将 Paypal 交易证明发送到服务器以确认和完成 iPhone 中的交易

标签 iphone ios paypal

我正在通过 NSlog 显示 NSDictionary,结果如下 这是您的付款证明:

{
client =     {
    environment = sandbox;
    "paypal_sdk_version" = "1.0.5";
    platform = iOS;
    "product_name" = "PayPal iOS SDK";
};
payment =     {
    amount = "190.50";
    "currency_code" = USD;
    "short_description" = Vegetables;
};
"proof_of_payment" =     {
    "adaptive_payment" =         {
        "app_id" = "APP-80W284485P519543T";
        "pay_key" = "AP-0W362760MW159460W";
        "payment_exec_status" = COMPLETED;
        timestamp = "2013-07-25T04:12:46.646-07:00";
    };
};

我已经阅读了文档 https://developer.paypal.com/webapps/developer/docs/integration/direct/make-your-first-call/ 从这个链接我得到了 PayPal REST API 使用 OAuth 2.0 框架进行授权。现在如何处理此结果以查看我的 Paypal 帐户(沙盒)中的一些真实流动交易?接下来做什么?我已经解析了 JSON 但如何通过简单地将它们存储在变量中来处理这些值?谢谢

最佳答案

当您使用 Paypal 完成交易后,您将获得一个“payKey” 在支付 paymentSuccessWithKey 委托(delegate)方法中。您可以在此处调用您的网络服务以将您的结果存储到您的服务器。

#pragma mark PayPalPaymentDelegate methods

-(void)paymentSuccessWithKey:(NSString *)payKey andStatus:(PayPalPaymentStatus)status; {
    paymentStatus = PAYMENTSTATUS_SUCCESS;
    NSLog(@"...payKey...........%@", payKey);
    [self performSelector:@selector(tellserverYouHavePaid:) withObject:payKey afterDelay:0.2];

}

-(void)tellserverYouHavePaid{
//call your web services here
}

关于iphone - 如何将 Paypal 交易证明发送到服务器以确认和完成 iPhone 中的交易,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17857197/

相关文章:

iphone - MPMoviePlayerController 在 iPhone 应用程序中反向(向后)播放电影不流畅

ios - Apple 推送通知服务 (APNS) SIM 更改

ios - 使用静态 UITableViewController 创建两个部分,第一部分具有非静态数量的单元格

php - 有谁知道抽象出支付网关之间差异的库?

android - 一个 map cURL 命令如何切换到一个自组装的 HTTP 请求?

等同于 GetExpressCheckoutDetails 的 PayPal REST API

ios - CoreData 查询返回零最初基于子对象 - 但退出后所有数据都存在

ios - 如何在单个 UIView 中启用两个不同 UIScrollview 的缩放?

ios - StoreKit 错误代码

ios - 如何获取按日期升序排列的项目?