2013-07-25 57 views
0

我正在通过的NSLog这导致作为 显示的NSDictionary这是您的付款证明:如何发送PayPal交易的证明服务器进行确认和交易的实现在iPhone

{ 
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/ 从这个链接,我得到了贝宝REST API使用进行授权的OAuth 2.0框架。现在如何处理这个结果做我的PayPal帐户(沙盒)来查看一些真正流动的交易?接下来做什么?我已经解析JSON但却怎样通过简单地将它们存储在变量这些值吗?谢谢

回答

2

当您的交易完成PayPal时,您将在付款paymentSuccessWithKey委托方法中获得“payKey” 。你可以在这里调用您的Web服务将结果保存到你的服务器。

#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 
}