Hello,
I'm using PHP SDK to charge already created "Customer Porifle" in Authorize. My question is: "How to attach Invoice Number to a
$profileToCharge = new AnetAPI\CustomerProfilePaymentType();
$profileToCharge->setCustomerProfileId($profileId);
$paymentProfile = new AnetAPI\PaymentProfileType();
$paymentProfile->setPaymentProfileId($paymentProfileId);
$paymentProfile->setCardCode($cvv);
$profileToCharge->setPaymentProfile($paymentProfile);
$transactionRequestType = new AnetAPI\TransactionRequestType();
$transactionRequestType->setTransactionType("authCaptureTransaction");
$transactionRequestType->setAmount($amount);
$transactionRequestType->setProfile($profileToCharge);
$request = new AnetAPI\CreateTransactionRequest();
$request->setMerchantAuthentication($this->merchantAuthentication);
$request->setRefId($this->refId);
$request->setTransactionRequest($transactionRequestType);
$controller = new AnetController\CreateTransactionController($request);
$response = $this->executeRequest($controller);
Solved! Go to Solution.
โ06-15-2022 07:47 AM
$orderType = new AnetAPI\OrderType();
$orderType->setInvoiceNumber($invoiceNumber);
$orderType->setDescription($description);
$transactionRequestType->setOrder($orderType);
//I think you can omit the description. Try it and see.
If you find this post helpful, please mark it as the solution and hit the kudos button.
โ06-15-2022 05:42 PM - edited โ06-15-2022 05:45 PM
$orderType = new AnetAPI\OrderType();
$orderType->setInvoiceNumber($invoiceNumber);
$orderType->setDescription($description);
$transactionRequestType->setOrder($orderType);
//I think you can omit the description. Try it and see.
If you find this post helpful, please mark it as the solution and hit the kudos button.
โ06-15-2022 05:42 PM - edited โ06-15-2022 05:45 PM
Thanks you so much! It works!
Is it description required property for OrderType?
โ06-15-2022 11:26 PM
I don't think so. For the client that I wrote that script for, they used it.
โ06-17-2022 02:49 PM
$orderType = new AnetAPI\OrderType(); $orderType->setInvoiceNumber($invoiceNumber); $orderType->setDescription($description); $transactionRequestType->setOrder($orderType); //I think you can omit the description. Try it and see.
If you find this post helpful, please mark it as the solution and hit the kudos button.
โ06-21-2022 01:39 PM