update thawani metadata
This commit is contained in:
parent
e4b8647526
commit
e4c9ede263
@ -122,7 +122,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
'cancel_url' => $cancelUrl,
|
||||
'metadata' => [
|
||||
'subscription_id' => $id,
|
||||
'customer_email' => $form['email']
|
||||
'customer_email' => $form['email'],
|
||||
'name' => $form['full_name'],
|
||||
'contact_number' => $form['whatsapp'],
|
||||
'email_id' => $form['email']
|
||||
]
|
||||
];
|
||||
|
||||
@ -141,7 +144,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$resData = json_decode($response, true);
|
||||
if (isset($resData['success']) && $resData['success'] && isset($resData['data']['session_id'])) {
|
||||
$sessionId = $resData['data']['session_id'];
|
||||
db()->query("UPDATE subscriptions SET thawani_reference = " . db()->quote($sessionId) . " WHERE id = " . $id);
|
||||
db()->query("UPDATE student_subscriptions SET thawani_reference = " . db()->quote($sessionId) . " WHERE id = " . $id);
|
||||
$thawaniRedirect = "$baseUrl/pay/$sessionId?key={$thawaniConfig['thawani_publishable_key']}";
|
||||
} else {
|
||||
error_log('Thawani Session Error: ' . $response);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user