-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayment2.php
More file actions
20 lines (17 loc) · 817 Bytes
/
payment2.php
File metadata and controls
20 lines (17 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
require_once( 'functions.php' );
if ( isset( $_POST[ 'paynowbtn' ] ) ) {
// Retrieve data from the form
$full_name = isset( $_POST[ 'cname' ] ) ? $_POST[ 'cname' ] : '';
$email = isset( $_POST[ 'cemail' ] ) ? $_POST[ 'cemail' ] : '';
$amount = isset( $_POST[ 'cpayamount' ] ) ? $_POST[ 'cpayamount' ] : 0;
$order_id = isset( $_POST[ 'corderID' ] ) ? $_POST[ 'corderID' ] : 0;
$user_id = isset( $_POST[ 'cID' ] ) ? $_POST[ 'cID' ] : 0;
// Assuming cID is the user ID
// Call the pay_url function
$payment_url = pay_url( $full_name, $email, $amount, $order_id, $user_id );
header("location: $payment_url");
// Display the payment link
echo 'IF do not redirect to payment please click <a href="'.htmlspecialchars( $payment_url ).'">Pay Now '.$amount.'</a>';
}
?>