【问题标题】:how to solve the error Unsupported Gateway Type for Storage in whmcs using stripe?如何解决错误 Unsupported Gateway Type for Storage in whmcs using stripe?
【发布时间】:2020-01-04 09:04:20
【问题描述】:

我想保存信用卡详细信息以备将来使用,并且我想将数据保存在 whmcs 数据库信用卡最后 4 位或 blob 格式的 card_data 中。我正在使用条带支付网关和 whmcs。

<?php
$command = 'AddPayMethod';//save the data in api format
$postData = array(
    'clientid' => $ca->getUserID(),//client id
    'type' => 'CreditCard', //credit card type
    'description' => 'Mohit - check',//account holder name
    'card_number' => '4640823519584356',//credit card number
    'card_expiry' => '0521',//credit card expiry date
    'gateway_module_name' => 'stripe'//payment method
);
$adminUsername = '';
$results = localAPI($command, $postData, $adminUsername); //show the api result or error
echo '<pre>';
print_r($results);
echo '</pre>';
?>

【问题讨论】:

    标签: stripe-payments whmcs


    【解决方案1】:

    您还没有使用任何模型,因此您将无法使用$ca-&gt;getUserID()。您还需要包含 WHMCS 的 init.php 文件。试试这个:

    <?php
    
    use WHMCS\ClientArea;
    require __DIR__ . '/init.php';
    $ca = new ClientArea();
    
    $command = 'AddPayMethod';//save the data in api format
    $postData = array(
        'clientid' => $ca->getUserID(),//client id
        'type' => 'CreditCard', //credit card type
        'description' => 'Mohit - check',//account holder name
        'card_number' => '4640823519584356',//credit card number
        'card_expiry' => '0521',//credit card expiry date
        'gateway_module_name' => 'stripe'//payment method
    );
    $adminUsername = '';
    $results = localAPI($command, $postData, $adminUsername); //show the api result or error
    echo '<pre>';
    print_r($results);
    echo '</pre>';
    ?>
    

    【讨论】:

      猜你喜欢
      • 2021-09-12
      • 1970-01-01
      • 2021-05-19
      • 2019-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-15
      相关资源
      最近更新 更多