Skip to content

Commit

Permalink
Add new hooks for Autoship Guest Checkout Compatibility, ref #606
Browse files Browse the repository at this point in the history
  • Loading branch information
kcppdevelopers committed Dec 7, 2016
1 parent 603ac89 commit 5fdc057
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions angelleye-includes/paypal-rest-api-utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public function create_payment($order, $card_data) {
$relatedResources = $transactions[0]->getRelatedResources();
$sale = $relatedResources[0]->getSale();
$saleId = $sale->getId();
do_action('before_save_payment_token', $order->id);
$order->add_order_note(__('PayPal Credit Card (REST) payment completed', 'paypal-for-woocommerce'));
if(!empty($_POST['wc-paypal_credit_card_rest-payment-token']) && $_POST['wc-paypal_credit_card_rest-payment-token'] == 'new') {
if(!empty($_POST['wc-paypal_credit_card_rest-new-payment-method']) && $_POST['wc-paypal_credit_card_rest-new-payment-method'] == true) {
Expand Down
1 change: 1 addition & 0 deletions classes/wc-gateway-braintree-angelleye.php
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ public function angelleye_do_payment($order) {
$is_sandbox = $this->sandbox == 'no' ? false : true;
update_post_meta($order->id, 'is_sandbox', $is_sandbox);
$order->payment_complete($this->response->transaction->id);
do_action('before_save_payment_token', $order->id);
if((!empty($_POST['wc-braintree-payment-token']) && $_POST['wc-braintree-payment-token'] == 'new') || ( $this->enable_braintree_drop_in && $this->supports( 'tokenization' ))) {
if((!empty($_POST['wc-braintree-new-payment-method']) && $_POST['wc-braintree-new-payment-method'] == true) || ($this->enable_braintree_drop_in && $this->supports( 'tokenization' ))) {
try {
Expand Down
1 change: 1 addition & 0 deletions classes/wc-gateway-paypal-advanced-angelleye.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ private function success_handler($order, $order_id, $silent_post) {
if ($inq_result == 'Approved') {//if approved
// Payment complete
$order->payment_complete($_POST['PNREF']);
do_action('before_save_payment_token', $order_id);
$is_save_payment_method = get_post_meta($order_id, '_is_save_payment_method', true);
if($is_save_payment_method == 'yes') {
$customer_id = $order->get_user_id();
Expand Down
2 changes: 1 addition & 1 deletion classes/wc-gateway-paypal-express-angelleye.php
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ function paypal_express_checkout($posted = null) {

update_post_meta($order_id, '_express_checkout_token', $this->get_session('TOKEN'));
update_post_meta( $order_id, '_first_transaction_id', $result['PAYMENTINFO_0_TRANSACTIONID'] );

do_action('before_save_payment_token', $order_id);
if( isset($result['BILLINGAGREEMENTID']) && !empty($result['BILLINGAGREEMENTID']) ) {
update_post_meta( $order_id, 'billing_agreement_id', $result['BILLINGAGREEMENTID'] );
if(!empty($_POST['wc-paypal_express-new-payment-method']) && $_POST['wc-paypal_express-new-payment-method'] == true) {
Expand Down
2 changes: 1 addition & 1 deletion classes/wc-gateway-paypal-pro-angelleye.php
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ function do_payment($order, $card_number, $card_type, $card_exp_month, $card_exp

$is_sandbox = $this->testmode == 'yes' ? true : false;
update_post_meta($order->id, 'is_sandbox', $is_sandbox);

do_action('before_save_payment_token', $order->id);
if(!empty($_POST['wc-paypal_pro-payment-token']) && $_POST['wc-paypal_pro-payment-token'] == 'new') {
if(!empty($_POST['wc-paypal_pro-new-payment-method']) && $_POST['wc-paypal_pro-new-payment-method'] == true) {
$customer_id = $order->get_user_id();
Expand Down
2 changes: 1 addition & 1 deletion classes/wc-gateway-paypal-pro-payflow-angelleye.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ function do_payment( $order, $card_number, $card_exp, $card_csc, $centinelPAResS

// Payment complete
//$order->add_order_note("PayPal Result".print_r($PayPalResult,true));
do_action('before_save_payment_token', $order->id);
if(!empty($_POST['wc-paypal_pro_payflow-payment-token']) && $_POST['wc-paypal_pro_payflow-payment-token'] == 'new') {
if(!empty($_POST['wc-paypal_pro_payflow-new-payment-method']) && $_POST['wc-paypal_pro_payflow-new-payment-method'] == true) {
$customer_id = $order->get_user_id();
Expand Down

0 comments on commit 5fdc057

Please sign in to comment.