You are here

abstract protected function CreditCardPaymentMethodBase::chargeCard in Ubercart 8.4

Called when a credit card should be processed.

@todo Replace the return array with a typed object.

Parameters

\Drupal\uc_order\OrderInterface $order: The order that is being processed. Credit card details supplied by the user are available in $order->payment_details[].

float $amount: The amount that should be charged.

string $txn_type: The transaction type, one of the UC_CREDIT_* constants.

string $reference: (optional) The payment reference, where needed for specific transaction types.

Return value

array Returns an associative array with the following members:

  • "success": TRUE if the transaction succeeded, FALSE otherwise.
  • "message": a human-readable message describing the result of the transaction.
  • "log_payment": TRUE if the transaction should be regarded as a successful payment.
  • "uid": The user ID of the person logging the payment, or 0 if the payment was processed automatically.
  • "comment": The comment string, markup allowed, to enter in the payment log.
  • "data": Any data that should be serialized and stored with the payment.
1 call to CreditCardPaymentMethodBase::chargeCard()
CreditCardPaymentMethodBase::processPayment in payment/uc_credit/src/CreditCardPaymentMethodBase.php
Process a payment through the credit card gateway.
3 methods override CreditCardPaymentMethodBase::chargeCard()
AuthorizeNet::chargeCard in payment/uc_authorizenet/src/Plugin/Ubercart/PaymentMethod/AuthorizeNet.php
Called when a credit card should be processed.
PayPalWebsitePaymentsPro::chargeCard in payment/uc_paypal/src/Plugin/Ubercart/PaymentMethod/PayPalWebsitePaymentsPro.php
Called when a credit card should be processed.
TestGateway::chargeCard in payment/uc_credit/src/Plugin/Ubercart/PaymentMethod/TestGateway.php
Called when a credit card should be processed.

File

payment/uc_credit/src/CreditCardPaymentMethodBase.php, line 665

Class

CreditCardPaymentMethodBase
Defines a base credit card payment method plugin implementation.

Namespace

Drupal\uc_credit

Code

protected abstract function chargeCard(OrderInterface $order, $amount, $txn_type, $reference = NULL);