Currently authorization,create_payment_token is supported but from what I understand of Cybersource API documentation the same request format is required for sale,create_payment_token.

Can we simply extend this with:

const COMMERCE_CYBERSOURCE_SAHC_TRANSACTION_SALE_CREATE_TOKEN = 'sale,create_payment_token';

and

    $form['transaction_type'] = [
      '#type' => 'select',
      '#title' => $this->t('Transaction type'),
      '#default_value' => $this->configuration['transaction_type'],
      '#required' => TRUE,
      '#options' => [
        self::COMMERCE_CYBERSOURCE_SAHC_TRANSACTION_AUTH_CREATE_TOKEN => $this->t('Authorize funds and create payment token'),
        self::COMMERCE_CYBERSOURCE_SAHC_TRANSACTION_SALE_CREATE_TOKEN => $this->t('Capture funds and create payment token'),
      ],
    ];
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

tko created an issue. See original summary.

tko’s picture

StatusFileSize
new1.18 KB
tko’s picture

Title: sale,create_payment_token support » sale transaction type
tko’s picture

Status: Active » Needs review
tko’s picture

lunk rat’s picture

Status: Needs review » Reviewed & tested by the community

We wondered why all of our transactions were getting authorized but not automatically settled. The config option provided by this patch resolved the issue for us. Marking RTBC.

rszrama’s picture

Title: sale transaction type » Add an SAHC transaction type for processing a sale and creating a token
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new2.92 KB

The patch as written did not properly update the order. I've revised the language and updated CyberSourceSahc::updatePayment() accordingly. Seems to work in a quick local test.

vmarchuk made their first commit to this issue’s fork.

vmarchuk’s picture

@rszrama

The patch looks good. I checked locally and opened MR to merge.

  • rszrama committed 2a157c05 on 8.x-1.x authored by vmarchuk
    Issue #3156909 by vmarchuk, tko, rszrama: Add an SAHC transaction type...
rszrama’s picture

Status: Needs review » Fixed

Cool, merging in. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.