Call to undefined method Shetabit\Multipay\Payment::getReferenceId()
Closed this issue · 1 comments
massooti commented
Detailed description
Hi there
I want to access recipt details after verifying purchase process just like the documente which you mentioned:
$path = config('payment');
$receipt = new PGW2($path);
$receipt->amount($payment->amount)->via($payment->gateway)->transactionId($transaction_id)->verify();
$receipt->getReferenceId()
but it gives me the error,
Call to undefined method Shetabit\Multipay\Payment::getReferenceId()
how can i access to detail of recipt ?
pls help
khanzadimahdi commented
Please follow the documents.
$payment = new Payment($paymentConfig);
// You need to verify the payment to ensure the invoice has been paid successfully.
// We use transaction id to verify payments
// It is a good practice to add invoice amount as well.
try {
$receipt = $payment->via('pasargad')->amount(1000)->transactionId($transaction_id)->verify();
// You can show payment referenceId to the user.
echo $receipt->getReferenceId();
...
} catch (InvalidPaymentException $exception) {
/**
when payment is not verified, it will throw an exception.
We can catch the exception to handle invalid payments.
getMessage method, returns a suitable message that can be used in user interface.
**/
echo $exception->getMessage();
}