"Undefined variable: name" when setting 'BillingAddr' object
Closed this issue · 1 comments
vedtam commented
Hi,
I have set up the Order object while following the mPAY24 docs. Now as a last step I wanted to fill the BillingAddr
object, but when I try to submit the order, before I get forwarded to the payment page, Laravel throws:
ErrorException (E_NOTICE)
Undefined variable: name
my pay function:
public function pay(Request $request) {
$cart = Cart::content();
$mpay24 = app()->mpay24;
$mdxi = app()->mpay24order;
// dd($cart);
$mdxi->Order->Tid = "1";
$mdxi->Order->Price = Cart::total();
$mdxi->Order->BillingAddr->setMode("ReadOnly");
$mdxi->Order->BillingAddr->Name = 'George';
$mdxi->Order->BillingAddr->Email = 'test@yahoo.co,';
$mdxi->Order->BillingAddr->Phone = '3334444555';
$mdxi->Order->BillingAddr->Street = 'Foo Street';
$mdxi->Order->BillingAddr->Zip = '999';
$mdxi->Order->BillingAddr->City = 'Foo City';
$mdxi->Order->BillingAddr->Country = 'Foo Country';
$mdxi->Order->URL->Success = 'http://mysite.com/success';
$mdxi->Order->URL->Error = 'http://mysite.com//error';
$mdxi->Order->URL->Confirmation = 'http://mysite.com//confirmation';
$paymentPageURL = $mpay24->paymentPage($mdxi)->getLocation(); // redirect location to the payment page
return redirect()->to($paymentPageURL);
}
if I comment out the BillingAddr
part, the payment gets forwarded to mPAY24, but obviously this is not what I want.
Btw when I open Mpay24Order
at line 75, I can't see any refrence to $name.
What could be wrong?