2016-03-15 13 views
0

不好意思問這個問題。因爲沒有可用的鏈接可用與此問題相關,但我的意圖有點不同,這就是我只是在此處發佈此問題的原因:在Apple App Store中提交應用程序之前,是否可以使用PayPal Live Credentials(clientID和sandboxID)測試iOS應用程序?

是否可以在Apple應用程序中提交應用程序之前使用PayPal Live Credentials檢查iOS應用程序商店?

的事情是,在蘋果方面有2個概念,如推送通知 & 應用程序內購買生產不發展),我們不能在測試時檢查。我感覺PayPal也一樣。但我在這一點毋庸置疑.....

使用:在我的應用程序https://simicart.zendesk.com/hc/en-us/articles/214860237-How-To-Obtain-API-Client-ID-And-Secret-Key-Within-Your-Paypal-Account-

我已經集成PayPal和它在沙箱罰款,但現在我想就現場應用程序ID現場運行所以我需要做什麼?

我在這裏面臨的問題一樣:Invalid merchant - payments to this merchant are not allowed (invalid clientId)

注:我在developer.paypal.com已經紅貝寶的iOS SDK整合過程中也

(1)「登錄到PayPal的開發人員網站使用註冊給應用程序所有者的PayPal帳戶的憑證。請注意,與應用程序關聯的PayPal帳戶必須是經過驗證的Premier或經過驗證的企業帳戶。

我做了同樣的事情。現在我正在使用有效的實時客戶端ID &沙盒密鑰。

ANDROID: LIVE憑證工作正常

的iOS:有人說像以往我在上面提到的什麼錯誤?

我該如何解決此問題?你能幫我解決嗎?

這裏我使用如下代碼:

#pragma mark 
#pragma mark -- connectToPayPalBtnClicked 
- (IBAction)connectToPayPalBtnClicked:(id)sender { 
// // Create a PayPalPayment 
    PayPalPayment *payment = [[PayPalPayment alloc] init]; 
    payment.amount = [[NSDecimalNumber alloc] initWithString:@"10.95"]; 
    //we recommend limiting transactions to currencies supported by both payment types. Currently these are: USD, GBP, CAD, EUR, JPY. 
    payment.currencyCode = @"USD"; 
    payment.shortDescription = @"Awesome saws"; 

    // Check whether payment is processable. 
    if (!payment.processable) { 
     // If, for example, the amount was negative or the shortDescription was empty, then 
    // this payment would not be processable. You would want to handle that here. 
} 
/* 
    For Test Account purpose 
    [PayPalMobile initializeWithClientIdsForEnvironments:@{ 
                 PayPalEnvironmentSandbox : PayPalClienKey}]; 
*/ 
[PayPalMobile initializeWithClientIdsForEnvironments:@{PayPalEnvironmentProduction : @"AU2qoYgXhfghgfhgfhfghhNS_QYjTSMV_LS4RmG-qbPGdXODlvJXuSE5jXQRAeJEwPvh6h4C", 
                 PayPalEnvironmentSandbox : @"ELQN7GqTJZDCH3Qfr17wyhfghfghgfhhg9esR9fyJ9prL6xKfFURMoAK0PZw0scTB5I6Un "}]; 

    #ifdef CONFIGURATION_ReleaseLive 
    [PayPalMobile preconnectWithEnvironment:PayPalEnvironmentProduction]; 
#else 
    [PayPalMobile preconnectWithEnvironment:PayPalEnvironmentSandbox]; // PayPalEnvironmentSandbox ? 
#endif 
    [self setPayPalConfig:[[PayPalConfiguration alloc] init]]; 
    [[self payPalConfig] setAcceptCreditCards:YES]; 
    [[self payPalConfig] setPayPalShippingAddressOption:PayPalShippingAddressOptionNone]; 
    [[self payPalConfig] setLanguageOrLocale:[NSLocale preferredLanguages][0]]; 
    // Create a PayPalPaymentViewController. 
    PayPalPaymentViewController *paymentViewController; 
    paymentViewController = [[PayPalPaymentViewController alloc] initWithPayment:payment 
                   configuration:self.payPalConfiguration 
                    delegate:self]; 

    // Present the PayPalPaymentViewController. 
    [self presentViewController:paymentViewController animated:YES completion:nil]; 
} 

#pragma mark - PayPalPaymentDelegate methods 
- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController 
      didCompletePayment:(PayPalPayment *)completedPayment { 
    NSLog(@"PayPal Payment Success!"); 
    // Payment was processed successfully; send to server for verification and fulfillment. 
    [self verifyCompletedPayment:completedPayment]; 

    // Dismiss the PayPalPaymentViewController. 
    [self dismissViewControllerAnimated:YES completion:nil]; 
} 

    - (void)payPalPaymentDidCancel:(PayPalPaymentViewController *)paymentViewController { 
    NSLog(@"PayPal Payment Canceled"); 
    // The payment was canceled; dismiss the PayPalPaymentViewController. 
    [self dismissViewControllerAnimated:YES completion:nil]; 
    } 
    - (void)verifyCompletedPayment:(PayPalPayment *)completedPayment { 
    // Send the entire confirmation dictionary 
     confirmation = [NSJSONSerialization dataWithJSONObject:completedPayment.confirmation 
                 options:0 
                 error:nil]; 
    NSLog(@"Here is your proof of payment:\n\n%@\n\nSend this to your server for confirmation and fulfillment.", completedPayment.confirmation); 

     // Send confirmation to your server; your server should verify the proof of payment 
     // and give the user their goods or services. If the server is not reachable, save 
    // the confirmation and try again later. 
    } 

回答

0

是的,你可以測試現場的憑據。它不需要Apple推送通知或應用程序內購買相同的權限。

除了在你的appDelegate增加生產clientID的,你需要在viewWillAppear中中添加該行的任何一個的viewController被加載PayPalPaymentViewController:

[PayPalMobile preconnectWithEnvironment:PayPalEnvironmentProduction]; 

現在,當貝寶退房的看法是加載您可以使用您自己的現場PayPal賬戶(請小心,因爲如果您進行支付,那將是真錢),而不是您設置的開發者賬戶。

+0

ThanQ @Ryan Friedman。如果您不知道我如何獲得客戶端實時生產密鑰,您可以與我分享一些示例代碼 –

相關問題