PayPal API:如何将其集成到我的应用程序中? IOS5

时间:2011-12-21 01:23:40

标签: ios api paypal details

我一直在检查PayPal API并得到这个,一个webView显示一个非常好的界面来通过PayPal支付,事情是:我不知道如何修改它以显示几个项目(仅此示例涉及一个)并在应用程序上显示它们(如果你已经使用它,你可能已经意识到它只是说“当前购买”,我认为这还不够)。

我一直在使用测试帐户作为买家,但在现实生活中,我如何将钱存入我的帐户?我的意思是,如果你看到代码和应用程​​序,它会说谁支付和相对多少,但它没有说明在哪里或向谁。

如果有人知道它可以帮助我,请。

P.D:关于它没有一个好的教程,很遗憾。

来自PayPal的样本:

(在我的ViewController中):

(void) loadView {
    [super loadView];

    UIWebView *aWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 00, 320,450)];
    aWebView.scalesPageToFit = YES;
    [aWebView setDelegate:self];

    NSString *item = @"Gum";
    NSInteger amount = 1;

    NSString *itemParameter = @"itemName=";
    itemParameter = [itemParameter stringByAppendingString:item];

    NSString *amountParameter = @"amount=";
    amountParameter = [amountParameter stringByAppendingFormat:@"%d",amount];

    NSString *urlString = @"http://haifa.baluyos.net/dev/PayPal/SetExpressCheckout.php?";
    urlString = [urlString stringByAppendingString:amountParameter];
    urlString = [urlString stringByAppendingString:@"&"];
    urlString = [urlString stringByAppendingString:itemParameter];



    //Create a URL object.
    NSURL *url = [NSURL URLWithString:urlString];

    //URL Requst Object
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];

    //load the URL into the web view.
    [aWebView loadRequest:requestObj];

    //[self.view addSubview:myLabel];
    [self.view addSubview:aWebView];
    [aWebView release];
}

1 个答案:

答案 0 :(得分:2)

我已经通过他们的MPL库在我的应用程序中集成了PayPal,我发现它最有趣。看来我没有有意识地看看PayPal网站(我仍然觉得它很混乱)。

MPL - >简单付款应用程序 - >复制和粘贴 - >修改它 - >工作精细。

如果有人像我一样迷失(并且我),请告知并发布一些代码。

由于