Closed armashfankar closed 7 years ago
Did you provide merchant id & key in your code as provided by paytm
Yes.
You can set config on the fly even as you wanted to set them up dynamically using this built in laravel function
config(['services.paytm-wallet.merchant_id' => 'YOUR_MERCHANT_ID'])
If you are facing issues with payment gateway, pease paste the snippet of code.
public function order() {
$payment = PaytmWallet::with('receive');
$payment->prepare([
'order' => '1',
'user' => '1',
'mobile_number' => '9967031001',
'email' => 'armashfankar@gmail.com',
'amount' => '20',
'callback_url' => 'http://slncn.com/callback'
]);
return $payment->receive();
}
public function paymentCallback()
{
$transaction = PaytmWallet::with('receive');
$response = $transaction->response(); // To get raw response as object'
dd($response);
//Check out response parameters sent by paytm here -> http://paywithpaytm.com/developer/paytm_api_doc?target=interpreting-response-sent-by-paytm
if($transaction->isSuccessful()){
//Transaction Successful
}else if($transaction->isFailed()){
//Transaction Failed
}else if($transaction->isOpen()){
//Transaction Open/Processing
}
//get important parameters via public methods
$transaction->getOrderId(); // Get order id
$transaction->getTransactionId(); // Get transaction id
}
Your code is absolutely correct, you can troubleshoot your code either way:- 1> Try changing the order id. 2> Contact paytm for valid credentials
And also make sure you wrote the config in config/services.php
file as mentioned in documentation.
i tried by changing order id and it worked. now issue is for callback.
i am redirected to paytm. i logged in using demo credentials provided by paytm. i completed transaction but in callback its showing me error.
Try contacting paytm regarding the issue. I can't help you with this, Try using production credentials.
Nothing is working.
'paytm-wallet' => [ 'env' => 'local', // values : (local | production) 'merchant_id' => '', 'merchant_key' => '', 'merchant_website' => 'WEB_STAGING', 'channel' => 'WEB', 'industry_type' => 'Retail', ]