从paypal sdk 2.0.1获取交易ID

时间:2014-04-01 07:09:04

标签: iphone ios7 paypal paypal-sandbox

如何从paypal sdk 2.0.1获取交易ID,我搜索了很多,但我坚持从paypal sdk 2.0.1获取交易ID。

检查下面的回复; -

{
client =
 {
    environment = sandbox;
    "paypal_sdk_version" = "2.0.1";
    platform = iOS;
    "product_name" = "PayPal iOS SDK";
 };
response =     
  {
    "create_time" = "2014-04-01T07:02:34Z";
    id = "PAY-3J588144TJ947892HKM5GJCQ";
    intent = sale;
    state = approved;
  };
"response_type" = payment;
 }

上面的代码我得到了工资ID但没有得到交易ID,我怎么能得到交易ID。???

1 个答案:

答案 0 :(得分:1)

您应该查看PayPal SDK文档Verify Mobile Payment。仔细查看SaleTransaction对象。

Sale对象有id字段:

id |    string  ID of the sale transaction.

您只需与REST API进行互动。

修改

尝试使用NSURLConnectionNSMutableRequest发送curl请求,如示例中所述:

  1. Converting a CURL command for Objective C

  2. Objective-c equivalent of curl request

  3. Basic HTTP Authentication Using iOS