This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
I'm trying to get parameters in a url returned from paypal on my component but I'm not getting it.
Url returned:
In my component class
class Success extends ComponentBase
{
public function onRun() {
$id = get('paymentId') //not work return null
$id = Input::get('paymentId') //not work return null
$id = post('paymentId') //not work return null
}
}
Can someone help?
You just access them like so:
// Returns the URL segment value, eg: /page/:post_id
$postId = $this->param('post_id');
Documentation here: http://octobercms.com/docs/plugin/components#routing-parameters
Also, just for future reference Input
will only provide access to POST and GET data, say thru a form.
Last updated
Just as an example, you can check this out to see how payments could be handled using Stripe. I know you are using PayPal but there just might be some similarities for you to understand things better.
https://github.com/pratyushpundir/oc-sublimeStripe NOTE: Don't use my plugin in production just yet. It's got some issues I'm resolving at present.
Thanks! this not work for me.
// Returns null
$id = $this->param('paymentId');
In session:
var_dump($data = Session:all());
return this:
["_previous"]=> array(1) { ["url"]=> string(133) "http://iepm.online/ajude-nos/doacao-concluida?PayerID=RB48JZQHUC6ZA&paymentId=PAY-9G395799LL040063BLEBB5YI&token=EC-0LL8923276633774V" }
I can not get the paymentId value
The problem paypal return url correctly, but error occurs 302 not found
http://iepm.online/ajude-nos/doacao-concluida?paymentId=PAY-8UM34694RP2150941LEBEBWI&token=EC-2A224201440691903&PayerID=RB48JZQHUC6ZA
Then redirects without parameters to url
http://iepm.online/ajude-nos/doacao-concluida
// that is why returns null
$id = $this->param('paymentId');
Last updated
1-5 of 5