fnando / paypal-recurring

PayPal Express Checkout API Client for recurring billing.
256 stars 124 forks source link

How to to encrypt parameters sent to Paypal ? #16

Open hopewise opened 11 years ago

hopewise commented 11 years ago

Here is my usage to the paypal-recurring gem in the checkout code:

ppr = PayPal::Recurring.new(
      return_url: new_subscription_url(:plan_id=>plan_id, :accounts_number => accounts_number),
      cancel_url: root_url,
      description: description,
      amount: price,
      currency: "USD"
    )

But, how to send parameters above encrypted to Paypal ? I tried to encrypt them like this:

ppr = PayPal::Recurring.new(
      cmd: '_s-xclick',
      encrypted: paypal_encrypted(new_subscription_url(:plan_id=>plan_id, :accounts_number => accounts_number), root_url)
    )

But, I got this error:

undefined method `cmd=' for #<PayPal::Recurring::Base:0xbf9e4fc>

Any idea ?

claudiosw commented 10 years ago

@hopewise, have you made this work? I would like to do this and I would appreciate any help on this.

CarlosRoque commented 9 years ago

Isn't this redundant since all paypal API endpoints are through SSL?