Issue saving card for customer



PHP Snippet 1:

QuickBooksOnline\Payments\Modules\Card

PHP Snippet 2:

$client = new PaymentClient([
    'access_token' => $accessTokenValue,
    'environment' => "sandbox" 
]);
    
    
$cardData = [
    "number" => "4408041234567893",
    "expMonth" => "12",
    "expYear" => "2026",
    "name" => "Test User",
    "address" => [
        "streetAddress" => "1245 Hana Rd",
        "city" => "Richmond",
        "region" => "VA",
        "country" => "US",
        "postalCode" => "44112"
    ],
    "customerid" => "94"
];

$chargeData = [
  "amount" => "10.55",
  "currency" => "USD",
  "card" => $cardData,
  "context" => [
        "mobile" => "false",
        "isEcommerce" => "true"
    ]
];
$customerId = "94";

$charge = ChargeOperations::buildFrom($chargeData);
$chargeResponse = $client->charge($charge);

$clientId = rand();
$card = CardOperations::buildFrom($cardData);
$createCardresponse = $client->createCard($card, $clientId, rand() . "abd");

//or alternatively $createCardresponse = $client->createCard($card, $customerId, rand() . "abd");