I have action which creating a payment and I need to redirect user to complete Payment. I used Pay API operation.
In Pay API it is said that:
You must redirect the sender to PayPal to complete the payment
But what is exact url ? Where I should redirect user in development and in production ?
Here is my controller:
}
EDIT
@xml = XmlSimple.xml_in(res.content)
payKey = @xml['payKey']
redirect_to "https://svcs.sandbox.paypal.com/AdaptivePayments/Pay?cmd=_ap-payment&paykey="+payKey.to_s()
From logs ERROR:
Redirected to https://svcs.sandbox.paypal.com/AdaptivePayments/Pay?cmd=_ap-payme
nt&paykey=["AP-7FC15543VK133501B"]
Completed 302 Found in 1780ms (ActiveRecord: 0.0ms)
[2012-07-18 20:01:53] ERROR URI::InvalidURIError: bad URI(is not URI?): https://svcs.sandbox.paypal.com/AdaptivePayments/Pay?cmd=_ap-payment&paykey=["AP-7FC15543VK133501B"]
So I need to delete [“”], yes ?
As per page 70 of the Adaptive Payments guide, you’ll need to redirect them to https://www.paypal.com/webscr?cmd=_ap-payment&paykey=value where ‘value’ is the payKey.
The equivalent URL for the sandbox (development) environment is https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey=value