From 72891d1753adf47e0318049c19a501c89c24f0cd Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Wed, 24 Jul 2013 12:56:21 -0700 Subject: [PATCH] NG selfservice webpay interface, #23579 --- FS/FS/ClientAPI_XMLRPC.pm | 2 ++ ng_selfservice/elements/post_thirdparty.php | 29 ++++++++++++++++++++++ ng_selfservice/payment_finish.php | 34 ++++++++++++++++++++++++++ ng_selfservice/payment_paypal.php | 38 ++++++++++++++++++++++++++++- ng_selfservice/payment_webpay.php | 38 ++++++++++++++++++++++++++++- 5 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 ng_selfservice/elements/post_thirdparty.php create mode 100644 ng_selfservice/payment_finish.php diff --git a/FS/FS/ClientAPI_XMLRPC.pm b/FS/FS/ClientAPI_XMLRPC.pm index 50b205687..6f37ce862 100644 --- a/FS/FS/ClientAPI_XMLRPC.pm +++ b/FS/FS/ClientAPI_XMLRPC.pm @@ -122,6 +122,8 @@ sub ss2clientapi { 'process_payment_change_pkg' => 'MyAccount/process_payment_change_pkg', 'process_payment_order_renew' => 'MyAccount/process_payment_order_renew', 'process_prepay' => 'MyAccount/process_prepay', + 'start_thirdparty' => 'MyAccount/start_thirdparty', + 'finish_thirdparty' => 'MyAccount/finish_thirdparty', 'realtime_collect' => 'MyAccount/realtime_collect', 'list_pkgs' => 'MyAccount/list_pkgs', #add to ss (added?) 'list_svcs' => 'MyAccount/list_svcs', #add to ss (added?) diff --git a/ng_selfservice/elements/post_thirdparty.php b/ng_selfservice/elements/post_thirdparty.php new file mode 100644 index 000000000..a543be93a --- /dev/null +++ b/ng_selfservice/elements/post_thirdparty.php @@ -0,0 +1,29 @@ + +

Redirecting to payment processor...

+
+
+ $value) { + echo("\n"); + } +} ?> + +
+
+ + diff --git a/ng_selfservice/payment_finish.php b/ng_selfservice/payment_finish.php new file mode 100644 index 000000000..413f497a3 --- /dev/null +++ b/ng_selfservice/payment_finish.php @@ -0,0 +1,34 @@ + + +finish_thirdparty($params); + + if ( isset($payment_results['error']) ) { + $error = $payment_results['error']; + include('elements/error.php'); + } else { +?> + + + + + + + + + + + + + + + + + diff --git a/ng_selfservice/payment_paypal.php b/ng_selfservice/payment_paypal.php index a2260890a..feb852dec 100644 --- a/ng_selfservice/payment_paypal.php +++ b/ng_selfservice/payment_paypal.php @@ -1,5 +1,41 @@ -PayPal payment +start_thirdparty(array( + 'session_id' => $_COOKIE['session_id'], + 'method' => 'PAYPAL', + 'amount' => $_POST['amount'], + )); + + include('elements/post_thirdparty.php'); + +} else { + + $payment_info = $freeside->payment_info( array( + 'session_id' => $_COOKIE['session_id'], + ) ); + + $tr_amount_fee = $freeside->mason_comp(array( + 'session_id' => $_COOKIE['session_id'], + 'comp' => '/elements/tr-amount_fee.html', + 'args' => [ 'amount', $payment_info['balance'] ], + )); + $tr_amount_fee = $tr_amount_fee['output']; + + include('elements/error.php'); ?> + +
Your payment details
Payment #
Payment amount + $ +
Processing # +
+ + + + + +
Amount Due$
+
+ + + diff --git a/ng_selfservice/payment_webpay.php b/ng_selfservice/payment_webpay.php index 638761d1a..ff82078b5 100644 --- a/ng_selfservice/payment_webpay.php +++ b/ng_selfservice/payment_webpay.php @@ -1,5 +1,41 @@ -Webpay +start_thirdparty(array( + 'session_id' => $_COOKIE['session_id'], + 'method' => 'CC', + 'amount' => $_POST['amount'], + )); + + include('elements/post_thirdparty.php'); + +} else { + + $payment_info = $freeside->payment_info( array( + 'session_id' => $_COOKIE['session_id'], + ) ); + + $tr_amount_fee = $freeside->mason_comp(array( + 'session_id' => $_COOKIE['session_id'], + 'comp' => '/elements/tr-amount_fee.html', + 'args' => [ 'amount', $payment_info['balance'] ], + )); + $tr_amount_fee = $tr_amount_fee['output']; + + include('elements/error.php'); ?> +
+ + + + + + +
Amount Due$
+
+ +
+ -- 2.11.0