Rams
Rams

Reputation: 1751

Paypal button problem

I have a PayPal Button tested in sandbox environment and it worked. Now i am trying to get it working in the live environment the button remains disable.

My code is

[PayPal initializeWithAppID:@"APP-80W284485P519543T" forEnvironment:ENV_LIVE];  
UIButton *button = [[PayPal getInstance] getPayButton:self buttonType:BUTTON_278x43 startCheckOut:@selector(payWithPayPal) PaymentType:DONATION withLeft:20 withTop:240];   
[self.view addSubview:button];

if I change Environment ENV_LIVE to ENV_SANDBOX the button is enable

Upvotes: 0

Views: 2029

Answers (3)

look
look

Reputation: 677

The live environment can be used only after your app has been approved by PayPal. The AppID you are using to initialize PayPal is hardcoded for use in the SANDBOX env. For a live application you need to use the App ID that is assigned to your app by PayPal. Follow the steps in this page to get an App ID for your app.

Remember, you need to have your own verified PayPal Premier or Business Account before the app will work (even if it is approved).

If you are submitting a mobile app take these extra steps

  1. iPhone (iOS) app must include:
    • ".app" and "mobile provision" file with UDIDs 396ea30899bb294607270258115a8eb9c929c021 AND 7754a0e4b281fd313f20d9e13c87534e26b091e3. Those are the two iPhones that PayPal will test with.
  2. iPad (iOS) app must include:
    • ".app" and "mobile provision" file with UDID 92e19f163eb553d42dfed00487fcaf73f7521c6e
  3. For an Android app, provide a link to your .apk file or attach the .apk file in the "Screen captures and any supporting documentation" of the application
  4. For a Blackberry app, provide a link to your .jad file or attach the .jad file in the "Screen captures and any supporting documentation" of the application
  5. For a Symbian app, provide a link to your .wgz file or attach the .wgz file in the "Screen captures and any supporting documentation" of the application

Once your app is approved, you'll receive a Live App ID. Just replace the Test App ID with the Live App ID, and change your Sandbox API credentials to Live API Credentials.

Upvotes: 2

RK-
RK-

Reputation: 12231

At times, when PayPal server is down or for any problems with server, the initialization of the PayPal object fails, and the button would be disabled in these cases.

You can check for the status of the initialization using the following code:

if ([PayPal initializationStatus] == STATUS_COMPLETED_SUCCESS) { //We have successfully initialized and are ready to pay
}

} 

From the documentation:

The “Pay with PayPal” button returned by the getPayButtonWithTarget method is disabled till the initialization is complete. Once the initialization is complete, if it was successful, the button will become enabled.

When initialization status returns STATUS_COMPLETED_ERROR - Request timeouts or host unavailable (Network connection failure) are valid initialization error cases for initializePayPal retry attempts.

If initialization failed due to a buyer error, the error message is presented as a UIAlertView.

Upvotes: 2

wan
wan

Reputation: 1406

You have to submit the app to paypal before converting it to live. They will provide you one id after testing your app in sandbox mode.

Check this link

https://www.x.com/community/ppx/xspaces/mobile/mep

Upvotes: 4

Related Questions