| 1 |
<?php |
| 2 |
die( __FILE__ ); |
| 3 |
class LP_Gateway_Paypal_Basic extends LP_Gateway_Paypal { |
| 4 |
public function get_request_url( $order_id ) { |
| 5 |
|
| 6 |
$user = learn_press_get_current_user(); |
| 7 |
|
| 8 |
$nonce = wp_create_nonce( 'learn-press-paypal-nonce' ); |
| 9 |
$order = new LP_Order( $order_id ); |
| 10 |
$custom = array( |
| 11 |
'order_id' => $order_id, |
| 12 |
'order_key' => $order->order_key, |
| 13 |
); |
| 14 |
|
| 15 |
$query = array( |
| 16 |
'cmd' => '_xclick', |
| 17 |
'amount' => learn_press_get_cart_total(), |
| 18 |
'quantity' => '1', |
| 19 |
'business' => $this->paypal_email, |
| 20 |
'item_name' => learn_press_get_cart_description(), |
| 21 |
'return' => esc_url_raw( |
| 22 |
add_query_arg( |
| 23 |
array( |
| 24 |
'learn-press-transaction-method' => 'paypal-standard', |
| 25 |
'paypal-nonce' => $nonce, |
| 26 |
) |
| 27 |
), |
| 28 |
learn_press_get_cart_course_url() |
| 29 |
), |
| 30 |
'currency_code' => learn_press_get_currency(), |
| 31 |
'notify_url' => get_home_url() /* SITE_URL */ . '/?' . learn_press_get_web_hook( 'paypal-standard' ) . '=1', |
| 32 |
'no_note' => '1', |
| 33 |
'shipping' => '0', |
| 34 |
'email' => $user->user_email, |
| 35 |
'rm' => '2', |
| 36 |
'cancel_return' => learn_press_get_cart_course_url(), |
| 37 |
'custom' => json_encode( $custom ), |
| 38 |
'no_shipping' => '1', |
| 39 |
); |
| 40 |
|
| 41 |
$query = apply_filters( 'learn_press_paypal_standard_query', $query ); |
| 42 |
|
| 43 |
$paypal_payment_url = $this->paypal_url . '?' . http_build_query( $query ); |
| 44 |
|
| 45 |
return $paypal_payment_url; |
| 46 |
} |
| 47 |
} |
| 48 |
|