Error 500

Bluewinters
Contributor
Contributor
Getting an error while attempting to create a billing plan: "Got Http response code 500 when accessing https://api.paypal.com/v1/payments/billing-plans/.'"
Happening on both sandbox and live.

Debug ID: 1e68b5b685bae

Code (PHP SDK): 
$plan = new Plan();
        $plan->setName('<SubscriptionName>')
             ->setDescription('<SubscriptionDescription>')
             ->setType('infinite');
        $paymentDefinition = new PaymentDefinition();
        $paymentDefinition->setName('Regular Payments')
                          ->setType('REGULAR')
                          ->setFrequency('Month')
                          ->setFrequencyInterval("1")
                          ->setCycles("0")
                          ->setAmount(new Currency(array('value' => 14.99, 'currency' => 'USD')));

        $paymentDefinition->setChargeModels(array(null));

        $merchantPreferences = new MerchantPreferences();
        $baseUrl = "<url>";

        $merchantPreferences->setReturnUrl("$baseUrl/ExecuteAgreement.php?success=true")
                            ->setCancelUrl("$baseUrl/ExecuteAgreement.php?success=false")
                            ->setAutoBillAmount("yes")
                            ->setInitialFailAmountAction("CONTINUE")
                            ->setMaxFailAttempts("2")
                            ->setSetupFee(new Currency(array('value' => 0, 'currency' => 'USD')));

        $plan->setPaymentDefinitions(array($paymentDefinition));
        $plan->setMerchantPreferences($merchantPreferences);

        $request = clone $plan;
        $output;

        try {
            $output = $plan->create($apiContext);
        } catch (Exception $ex) {
            echo 'Error: '.$ex.'.';
            die;
        }
Login to Me Too
1 REPLY 1

Bluewinters
Contributor
Contributor

Update,

Just before anyone asks yes we are within the latest version of TLS 1.2 as well as HTTPS 1.1

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.