Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-3302

Email for paying with auth/capture gateway has missing tags

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.7.1
    • Fix Version/s: 4.7.2, 4.8.0-b1
    • Component/s: None
    • Labels:
      None

      Description

      When making payment with a gateway the uses the authorize/capture flow, there are a couple issues. First, the GatewayPayments authorizePayment() method does not link the payment account to the transaction it creates. Second, the GatewayPayment capturePayment() method does not include the company as an email tag like the processPayment() method does.

        Activity

        jonathan Jonathan Reissmueller created issue -
        jonathan Jonathan Reissmueller made changes -
        Field Original Value New Value
        Rank Ranked higher
        Hide
        jonathan Jonathan Reissmueller added a comment - - edited

        Possible solution given to a client.
        On line of components/gateway_payments/gateway_payments.php 939 change:

                $transaction_id = $this->Transactions->add([
                    'client_id' => $client_id,
                    'amount' => $amount,
                    'currency' => $currency,
                    'type' => $type,
                    'gateway_id' => $gateway->id,
                    'transaction_id' => $response['transaction_id'],
                    'reference_id' => isset($response['reference_id']) ? $response['reference_id'] : null,
                    'status' => $response['status']
                ]);
        

        to

                $transaction_id = $this->Transactions->add([
                    'client_id' => $client_id,
                    'amount' => $amount,
                    'currency' => $currency,
                    'type' => $type,
                    'gateway_id' => $gateway->id,
                    'account_id' => $account_id,
                    'transaction_id' => $response['transaction_id'],
                    'reference_id' => isset($response['reference_id']) ? $response['reference_id'] : null,
                    'status' => $response['status']
               ]);
        

        On line 1127 change :

                        $tags = [
                            'contact' => $contact,
                            'amount' => $this->CurrencyFormat->format($amount, $transaction->currency),
                            'transaction_id' => $transaction->id,
                            'response' => $response,
                            'last_four' => (isset($account->last4) ? $account->last4 : null)
                        ];
        

        to

                        $tags = [
                            'contact' => $contact,
                            'amount' => $this->CurrencyFormat->format($amount, $transaction->currency),
                            'transaction_id' => $transaction->id,
                            'response' => $response,
                            'last_four' => (isset($account->last4) ? $account->last4 : null),
                            'company' => $this->Companies->get($this->company_id)
                        ];
        

        On lines 1134-1137 change from:

                            // Set credit card specific tags
                            if ($transaction->type == 'cc' && isset($account->type)) {
                                $tags['card_type'] = Language::_('Gateways.card_types.' . $account->type, true);
                            }
        

        to

                            // Set credit card specific tags
                            if ($transaction->type == 'cc' && isset($account->type)) {
                                $card_types = $this->Accounts->getCcTypes();
                                $tags['card_type'] = isset($card_types[$account->type])
                                    ? $card_types[$account->type]
                                    : null;
                            }
        
        Show
        jonathan Jonathan Reissmueller added a comment - - edited Possible solution given to a client. On line of components/gateway_payments/gateway_payments.php 939 change: $transaction_id = $ this ->Transactions->add([ 'client_id' => $client_id, 'amount' => $amount, 'currency' => $currency, 'type' => $type, 'gateway_id' => $gateway->id, 'transaction_id' => $response['transaction_id'], 'reference_id' => isset($response['reference_id']) ? $response['reference_id'] : null , 'status' => $response['status'] ]); to $transaction_id = $ this ->Transactions->add([ 'client_id' => $client_id, 'amount' => $amount, 'currency' => $currency, 'type' => $type, 'gateway_id' => $gateway->id, 'account_id' => $account_id, 'transaction_id' => $response['transaction_id'], 'reference_id' => isset($response['reference_id']) ? $response['reference_id'] : null , 'status' => $response['status'] ]); On line 1127 change : $tags = [ 'contact' => $contact, 'amount' => $ this ->CurrencyFormat->format($amount, $transaction->currency), 'transaction_id' => $transaction->id, 'response' => $response, 'last_four' => (isset($account->last4) ? $account->last4 : null ) ]; to $tags = [ 'contact' => $contact, 'amount' => $ this ->CurrencyFormat->format($amount, $transaction->currency), 'transaction_id' => $transaction->id, 'response' => $response, 'last_four' => (isset($account->last4) ? $account->last4 : null ), 'company' => $ this ->Companies->get($ this ->company_id) ]; On lines 1134-1137 change from: // Set credit card specific tags if ($transaction->type == 'cc' && isset($account->type)) { $tags['card_type'] = Language::_('Gateways.card_types.' . $account->type, true ); } to // Set credit card specific tags if ($transaction->type == 'cc' && isset($account->type)) { $card_types = $ this ->Accounts->getCcTypes(); $tags['card_type'] = isset($card_types[$account->type]) ? $card_types[$account->type] : null ; }
        tyson Tyson Phillips (Inactive) made changes -
        Sprint 4.8.0 Sprint 4 [ 95 ]
        tyson Tyson Phillips (Inactive) made changes -
        Rank Ranked lower
        tyson Tyson Phillips (Inactive) made changes -
        Rank Ranked lower
        jonathan Jonathan Reissmueller made changes -
        Assignee Jonathan Reissmueller [ jonathan ]
        Automated transition triggered when Jonathan Reissmueller created a branch in Stash -
        Status Open [ 1 ] In Progress [ 3 ]
        jonathan Jonathan Reissmueller made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 25 minutes [ 1500 ]
        Worklog Id 12739 [ 12739 ]
        Automated transition triggered when Jonathan Reissmueller created pull request #757 in Stash -
        Status In Progress [ 3 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        Automated transition triggered when Tyson Phillips (Inactive) merged pull request #757 in Stash -
        Status In Review [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            jonathan Jonathan Reissmueller
            Reporter:
            jonathan Jonathan Reissmueller
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Nov/19

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 25 minutes
              25m

                Agile