/* sandbox api */
'sandboxApiPurchaseUrl' => 'https://sandbox.zarinpal.com/pg/services/WebGate/wsdl',
'sandboxApiPaymentUrl' => 'https://sandbox.zarinpal.com/pg/StartPay/',
'sandboxApiVerificationUrl' => 'https://sandbox.zarinpal.com/pg/services/WebGate/wsdl',
/* zarinGate api */
'zaringateApiPurchaseUrl' => 'https://ir.zarinpal.com/pg/services/WebGate/wsdl',
'zaringateApiPaymentUrl' => 'https://www.zarinpal.com/pg/StartPay/:authority/ZarinGate',
'zaringateApiVerificationUrl' => 'https://ir.zarinpal.com/pg/services/WebGate/wsdl',
'mode' => 'normal', // can be normal, sandbox, zaringate
'merchantId' => 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
'callbackUrl' => 'http://spirutik.com/',
'description' => 'payment using zarinpal',
],`
,
و اما در کنترلر:
public function Sending_to_zarinpal(Bill $bill){ $invoice = new Invoice; $invoice->amount($bill->price)->via('zarinpal')->transactionId(123); $invoice->detail(['detailName' => 'your detail goes here']); return Payment::purchase($invoice, function($driver, $transactionId) { // Store transactionId in database as we need it to verify payment in the future. })->pay()->render();
من دارم طبق داکیومنت عمل میکنم ولی بازم ارور اطلاعات ارسال شده ناقص است. رو میده.در زیر کدهام میزارم اول فایل payment.php `'zarinpal' => [ / normal api / 'apiPurchaseUrl' => 'https://ir.zarinpal.com/pg/services/WebGate/wsdl', 'apiPaymentUrl' => 'https://www.zarinpal.com/pg/StartPay/', 'apiVerificationUrl' => 'https://ir.zarinpal.com/pg/services/WebGate/wsdl',
, و اما در کنترلر:
public function Sending_to_zarinpal(Bill $bill){ $invoice = new Invoice; $invoice->amount($bill->price)->via('zarinpal')->transactionId(123); $invoice->detail(['detailName' => 'your detail goes here']); return Payment::purchase($invoice, function($driver, $transactionId) { // Store transactionId in database as we need it to verify payment in the future. })->pay()->render();