Skip to content

Commit

Permalink
Merge pull request #28 from mayur-vachchewar/transit-payment-issue
Browse files Browse the repository at this point in the history
fixed for payment failed issue
  • Loading branch information
securesubmit-buildmaster authored Sep 8, 2022
2 parents 9d935ac + 04d6a63 commit 3a61e8c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion globalpayments-gateway-provider-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: GlobalPayments WooCommerce
* Plugin URI: https://github.com/globalpayments/globalpayments-woocommerce
* Description: This extension allows WooCommerce to use the available Global Payments payment gateways. All card data is tokenized using the respective gateway's tokenization service.
* Version: 1.4.0
* Version: 1.4.1
* Requires PHP: 7.1
* WC tested up to: 6.6.0
* Author: Global Payments
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: globalpayments
Tags: woocommerce, woo, unified, commerce, platform, global, payments, heartland, payment, systems, tsys, genius, 3DS, gateway, token, tokenize, save cards
Requires at least: 5.4
Tested up to: 6.0
Stable tag: 1.2.3
Tested up to: 6.0.1
Stable tag: 1.2.4
License: MIT
License URI: https://github.com/globalpayments/globalpayments-woocommerce/blob/main/LICENSE

Expand Down Expand Up @@ -48,6 +48,9 @@ Access to our Unified Payments requires sandbox credentials which you can retrie

== Changelog ==

= 1.4.1 =
* Bug fix - fixed for payment failed issue (transIt)

= 1.4.0 =
* Unified Payments - added Card Holder Name for Hosted Fields
* Add Merchant Name option for the Google Pay gateway
Expand Down
12 changes: 9 additions & 3 deletions src/Gateways/AbstractGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -1070,9 +1070,15 @@ protected function handle_response( Requests\RequestInterface $request, Transact
//check admin selected decline condtions
if ( in_array( $response->avsResponseCode, $this->get_option( 'avs_reject_conditions' ) ) ||
in_array( $response->cvnResponseCode, $this->get_option( 'cvn_reject_conditions' ) ) ) {
Transaction::fromId( $response->transactionReference->transactionId )
->reverse( $request->order->data['total'] )
->execute();
$data = $request->order->get_data();

if (!is_array($data)) {
$data = [];
}

Transaction::fromId($response->transactionReference->transactionId)
->reverse($data['total'])
->execute();

return false;
}
Expand Down
14 changes: 13 additions & 1 deletion src/Gateways/Clients/SdkClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,26 @@ public function execute() {
$this->set_threedsecure_data();
}
$response = $builder->execute();
if ( ! is_null( $this->card_data ) && $response instanceof Transaction && $response->token ) {
if (
$this->is_gateway(GatewayProvider::PORTICO)
&& !is_null($this->card_data)
&& $response instanceof Transaction
&& $response->token
) {
$this->card_data->token = $response->token;
$this->card_data->updateTokenExpiry();
}

return $response;
}

protected function is_gateway($gatewayProvider)
{
return isset($this->args['SERVICES_CONFIG'])
&& isset($this->args['SERVICES_CONFIG']['gatewayProvider'])
&& $this->args['SERVICES_CONFIG']['gatewayProvider'] === $gatewayProvider;
}

public function submit_request( RequestInterface $request ) {
$this->prepare_request_args( $request );
$this->configure_sdk();
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Plugin {
*
* @var string
*/
const VERSION = '1.4.0';
const VERSION = '1.4.1';

/**
* Init the package.
Expand Down

0 comments on commit 3a61e8c

Please sign in to comment.