src/SecucardConnect/Product/Payment/Service/PaymentService.php
public function cancel($paymentId, $contractId = null, $amount = null, $reduceStakeholderPayment = false)
    {
        $object = [
            'contract' => $contractId,
            'amount' => $amount,
            'reduce_stakeholder_payment' => $reduceStakeholderPayment
        ];
        $res = $this->execute($paymentId, 'cancel', null, $object);

        if (is_object($res)) {
            return $res;
        }

        return $res;
    }
public function cancel($paymentId, $contractId = null, $amount = null, $reduceStakeholderPayment = false)
    {
        $object = [
            'contract' => $contractId,
            'amount' => $amount,
            'reduce_stakeholder_payment' => $reduceStakeholderPayment
        ];
        $res = $this->execute($paymentId, 'cancel', null, $object);

        if (is_object($res)) {
            return $res;
        }

        return $res;
    }
public function cancel ( $ paymentId , $ contractId = null , $ amount = null , $ reduceStakeholderPayment = false ) { $ object = [ 'contract' => $ contractId , 'amount' => $ amount , 'reduce_stakeholder_payment' => $ reduceStakeholderPayment ] ; $ res = $ this -> execute ( $ paymentId , 'cancel' , null , $ object ) ; if ( is_object ( $ res ) ) { return $ res ; } return $ res ; }
Cancel or Refund an existing transaction.
Currently, partial refunds are are not allowed for all payment products.

@param string $paymentId The payment transaction id.
@param string $contractId The id of the contract that was used to create this transaction.
@param int $amount The amount that you want to refund to the payer. Use '0' for a full refund.
@param bool $reduceStakeholderPayment TRUE if you want to change the amount of the stakeholder positions too (on partial refund)

@return array ['result', 'demo', 'new_trans_id', 'remaining_amount', 'refund_waiting_for_payment']
@throws GuzzleException
@throws ApiError
@throws AuthError
@throws ClientError
Cancel or Refund an existing transaction . Currently partial refunds are are not allowed for all payment products .