Skip to content

Recurring payments error #5

@hkdobrev

Description

@hkdobrev

A bug report from Victor Kosh:

I use your Bundle in my symfony2 project, and I'm happy with it, but there is a little problem with recurring payments, I had this error

"PayPal API request did not succeed for https://api-3t.sandbox.paypal.com/nvp failed: Item name, amount and quantity are required if item category is provided. (10003). "

To fix it I went to OpenBuildings/Paypal/Payment/Recurring.php to class Payment_Recurring

found function protected function _set_params() and removed the line
'L_PAYMENTREQUEST_0_ITEMCATEGORY0' => 'Digital',

Now everything works well, but I don't like the way I fixed it.

It would be great if you have time to help me find out what is wrong.

Here is order of my actions:

\OpenBuildings\PayPal\Payment::instance('Recurring')
    ->config(array(
        "username" => $this->paypalUsername,
        "password" => $this->paypalPassowrd,
        "signature" => $this->paypalSignature,
        "client_id" => $this->paypalClientId,
        "secret" => $this->paypalSecret,
        "description"=>$this->userSubscriptionDescription,
        "amount_per_month"=>1,
        "charged_yearly"=>true,
        "billing_period"=>"Day",
        "billing_frequency"=>"1",
        "amount"=>$this->userSubscriptionPrice
    ));
$instance = \OpenBuildings\PayPal\Payment::instance('Recurring')->order(array(
        'items_price' => $itemPrice,
        'shipping_price' => $shippingPrice,
        'total_price' => $totalPrice,
    ))
    ->return_url($returnUrl)
    ->cancel_url($cancelUrl);
$instance->set_express_checkout();  // here I had that error

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions