Edit Payment Retun Parameter

Hi,

I use 2checkout for different websites hosted on the same server. I need to add the following for 2checkout on Ninja Invoice,

&x_receipt_link_url=https://www.mkiddtech.co.uk/invoice/public/complete

I cant work out where to add this, can anyone help?

You’ll most likely need to modify this file:

app/Ninja/PaymentDrivers/TwoCheckoutPaymentDriver.php

You may be able to do this by overriding the paymentDetails function as seen here:

https://github.com/invoiceninja/invoiceninja/blob/master/app/Ninja/PaymentDrivers/PayPalExpressPaymentDriver.php#L13

Hi Hillel Coren,

Thank you for your post, I was just about to make an update to this post, I figured it out after scrolling though hundreds of lines of code from various scripts!

It needed to be passed to 2checkout with the Product ID, which i eventually found gets generated in,

/ninja/app/Http/Controllers/OnlinePaymentController.php on line 286

changed it from

    $product = Product::scope(Input::get('product_id'))->first();

to

    $product = Product::scope(Input::get('product_id&x_receipt_link_url=https://www.mkiddtech.co.uk/invoice/public/complete'))->first();

did a test purchase and success!

I’m happy it works but I’m not sure how or why, the code doesn’t look right to me.

I admit it might not be in the technically correct place or script, but it seems to work. I’m no coding expert lol

It would be handy to have an option for this built into the application from the GUI with a simple enable switch.

I believe x_receipt_link_url is already being set, I’m not sure your change has an effect.

https://github.com/thephpleague/omnipay-2checkout/blob/master/src/Message/PurchaseRequest.php#L45