One Hat Cyber Team
Your IP:
216.73.216.102
Server IP:
198.54.114.155
Server:
Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
Server Software:
LiteSpeed
PHP Version:
5.6.40
Create File
|
Create Folder
Execute
Dir :
~
/
home
/
fluxyjvi
/
www
/
assets
/
images
/
View File Name :
doc.tar
CP.markdown 0000644 00000002265 15107406326 0006623 0 ustar 00 Card Present API ================ Basic Overview -------------- The AuthorizeNetCP class creates a request object for submitting transactions to the AuthorizeNetCP API. The AuthorizeNetCP class extends the AuthorizeNetAIM class. See the AIM.markdown for help with the basics. This document contains information regarding the special features of the AuthorizeNetCP class. Merchant Credentials -------------------- Please note that if you are using both the CNP and CP APIs your merchant credentials will be different. Setting Track Data ------------------ To set Track 1 and/or Track 2 data, use the respective methods like so: ```PHP $sale = new AuthorizeNetCP(CP_API_LOGIN_ID, CP_TRANSACTION_KEY); $sale->setFields( array( 'amount' => rand(1, 1000), 'device_type' => '4', ) ); $sale->setTrack1Data('%B4111111111111111^CARDUSER/JOHN^1803101000000000020000831000000?'); $response = $sale->authorizeAndCapture(); $sale = new AuthorizeNetCP(CP_API_LOGIN_ID, CP_TRANSACTION_KEY); $sale->setFields( array( 'amount' => rand(1, 1000), 'device_type' => '4', ) ); $sale->setTrack2Data('4111111111111111=1803101000020000831?'); $response = $sale->authorizeAndCapture(); ``` DPM.markdown 0000644 00000001441 15107406326 0006734 0 ustar 00 Direct Post Method ================== Basic Overview -------------- The Authorize.Net PHP SDK includes a class that demonstrates one way of implementing the Direct Post Method. While it is not necessary to use the AuthorizeNetDPM class to implement DPM, it may serve as a handy reference. The AuthorizeNetDPM class extends the AuthorizeNetSIM_Form class. See the SIM.markdown for additional documentation. Relay Response Snippet ---------------------- The AuthorizeNetDPM class contains a `getRelayResponseSnippet($redirect_url)` which generates a snippet of HTML that will redirect a user back to your site after submitting a checkout form using DPM/SIM. Use this method(or just grab the html) if you want to create a checkout experience where the user only interacts with pages on your site. README.md 0000644 00000000501 15107406326 0006023 0 ustar 00 # This documentation and the objects it documents have been deprecated For the README for this repository, see README.md in the root level of the repository. For examples of how to interact with the current Authorize.Net API, see our new sample code GitHub repository at https://github.com/AuthorizeNet/sample-code-php. SIM.markdown 0000644 00000004501 15107406326 0006744 0 ustar 00 Server Integration Method ========================= Basic Overview -------------- The Authorize.Net PHP SDK includes classes that can speed up implementing a Server Integration Method solution. Hosted Order/Receipt Page ------------------------- The `AuthorizeNetSIM_Form` class aims to make it easier to setup the hidden fields necessary for creating a SIM experience. While it is not necessary to use the `AuthorizeNetSIM_Form` class to implement SIM, it may be handy for reference. The code below will generate a buy now button that leads to a hosted order page: ```PHP <form method="post" action="https://test.authorize.net/gateway/transact.dll"> <?php $amount = "9.99"; $fp_sequence = "123"; $time = time(); $fingerprint = AuthorizeNetSIM_Form::getFingerprint($api_login_id, $transaction_key, $amount, $fp_sequence, $time); $sim = new AuthorizeNetSIM_Form( array( 'x_amount' => $amount, 'x_fp_sequence' => $fp_sequence, 'x_fp_hash' => $fingerprint, 'x_fp_timestamp' => $time, 'x_relay_response'=> "FALSE", 'x_login' => $api_login_id, ) ); echo $sim->getHiddenFieldString();?> <input type="submit" value="Buy Now"> </form> ``` Fingerprint Generation ---------------------- To generate the fingerprint needed for a SIM transaction call the `getFingerprint` method: ```PHP $fingerprint = AuthorizeNetSIM_Form::getFingerprint($api_login_id, $transaction_key, $amount, $fp_sequence, $fp_timestamp); ``` Relay Response -------------- The PHP SDK includes a `AuthorizeNetSIM` class for handling a relay response from Authorize.Net. To receive a relay response from Authorize.Net you can either configure the url in the Merchant Interface or specify the url when submitting a transaction with SIM using the "x_relay_url" field. When a transaction occurs, Authorize.Net will post the transaction details to this url. You can then create a page on your server at a url such as http://yourdomain.com/response_handler.php and execute any logic you want when a transaction occurs. The AuthorizeNetSIM class makes it easy to verify the transaction came from Authorize.Net and parse the response: ```PHP $response = new AuthorizeNetSIM; if ($response->isAuthorizeNet()) { if ($response->approved) { // Activate magazine subscription magazine_subscription_activate($response->cust_id); } } ``` ARB.markdown 0000644 00000003170 15107406326 0006721 0 ustar 00 ARB API ======= Basic Overview -------------- The AuthorizeNetARB class creates a request object for submitting transactions to the AuthorizeNetARB API. Creating/Updating Subscriptions ------------------------------- To create or update a subscription first create a subscription object: ```PHP $subscription = new AuthorizeNet_Subscription; $subscription->name = "Short subscription"; $subscription->intervalLength = "1"; $subscription->intervalUnit = "months"; $subscription->startDate = "2011-03-12"; $subscription->totalOccurrences = "14"; $subscription->amount = rand(1,100); $subscription->creditCardCardNumber = "6011000000000012"; $subscription->creditCardExpirationDate = "2018-10"; $subscription->creditCardCardCode = "123"; $subscription->billToFirstName = "john"; $subscription->billToLastName = "doe"; ``` Then create an AuthorizeNetARB object and call the appropriate method passing in your subscription object: ```PHP $request = new AuthorizeNetARB; $response = $request->createSubscription($subscription); ``` or for updating a subscription: ```PHP $response = $request->updateSubscription($subscription_id, $subscription); ``` Getting Subscription Status --------------------------- Create a new AuthorizeNetARB object and call the getSubscriptionStatus method with the subscription_id you want the status of as the parameter: ```PHP $status_request = new AuthorizeNetARB; $status_response = $status_request->getSubscriptionStatus($subscription_id); ``` Canceling a Subscription ------------------------ ```PHP $cancellation = new AuthorizeNetARB; $cancel_response = $cancellation->cancelSubscription($subscription_id); ``` AIM.markdown 0000644 00000012305 15107406326 0006723 0 ustar 00 Advanced Integration Method =========================== Basic Overview -------------- The AuthorizeNetAIM class creates a request object for submitting transactions to the AuthorizeNetAIM API. To use, create an instance of the class, set the fields for your transaction, call the method you want to use (Authorize Only, Authorize & Capture, etc.) and you'll receive an AuthorizeNetAIM response object providing easy access to the results of the transaction. Autoloading ----------------- ```PHP require 'vendor/autoload.php'; ``` Setting Merchant Credentials ---------------------------- The easiest way to set credentials is to define constants which the SDK uses: ```PHP define("AUTHORIZENET_API_LOGIN_ID", "YOURLOGIN"); define("AUTHORIZENET_TRANSACTION_KEY", "YOURKEY"); ``` You can also set credentials manually per request like so: ```PHP $sale = new AuthorizeNetAIM("YOUR_API_LOGIN_ID","YOUR_TRANSACTION_KEY"); ``` Setting the Transaction Post Location ------------------------------------- To post transactions to the live Authorize.Net gateway: ```PHP define("AUTHORIZENET_SANDBOX", false); ``` To post transactions to the Authorize.Net test server: ```PHP define("AUTHORIZENET_SANDBOX", true); ``` You can also set the location manually per request: ```PHP $sale->setSandbox(false); ``` Setting Fields -------------- An Authorize.Net AIM request is simply a set of name/value pairs. The PHP SDK allows you to set these fields in a few different ways depending on your preference. Note: to make things easier on the developer, the "x_" prefix attached to each field in the AIM API has been removed. Thus, instead of setting `$sale->x_card_num`, set `$sale->card_num` instead. 1.) By Setting Fields Directly: ```PHP $sale = new AuthorizeNetAIM; $sale->amount = "1999.99"; $sale->card_num = '6011000000000012'; $sale->exp_date = '04/15'; $response = $sale->authorizeAndCapture(); ``` 2.) By Setting Multiple Fields at Once: ```PHP $sale = new AuthorizeNetAIM; $sale->setFields( array( 'amount' => rand(1, 1000), 'card_num' => '6011000000000012', 'exp_date' => '0415' ) ); ``` 3.) By Setting Special Items To add line items or set custom fields use the respective functions: Line Items: ```PHP $sale->addLineItem( 'item1', // Item Id 'Golf tees', // Item Name 'Blue tees', // Item Description '2', // Item Quantity '5.00', // Item Unit Price 'N' // Item taxable ); ``` Custom Fields: ```PHP $sale->setCustomField("coupon_code", "SAVE2011"); ``` 4.) By Passing in Objects Each property will be copied from the object to the AIM request. ```PHP $sale = new AuthorizeNetAIM; $customer = (object)array(); $customer->first_name = "Jane"; $customer->last_name = "Smith"; $customer->company = "Jane Smith Enterprises Inc."; $customer->address = "20 Main Street"; $customer->city = "San Francisco"; $customer->state = "CA"; $customer->zip = "94110"; $customer->country = "US"; $customer->phone = "415-555-5557"; $customer->fax = "415-555-5556"; $customer->email = "foo@example.com"; $customer->cust_id = "55"; $customer->customer_ip = "98.5.5.5"; $sale->setFields($customer); ``` Submitting Transactions ----------------------- To submit a transaction call one of the 7 methods: ```PHP AuthorizeNetAIM::authorizeAndCapture() AuthorizeNetAIM::authorizeOnly() AuthorizeNetAIM::priorAuthCapture() AuthorizeNetAIM::void() AuthorizeNetAIM::captureOnly() AuthorizeNetAIM::credit() ``` Each method has optional parameters which highlight the fields required by the Authorize.Net API for that transaction type. eCheck ------ To submit an electronic check transaction you can set the required fields individually or simply use the setECheck method: ```PHP $sale = new AuthorizeNetAIM; $sale->amount = "45.00"; $sale->setECheck( '121042882', // bank_aba_code '123456789123', // bank_acct_num 'CHECKING', // bank_acct_type 'Bank of Earth', // bank_name 'Jane Doe', // bank_acct_name 'WEB' // echeck_type ); $response = $sale->authorizeAndCapture(); ``` Partial Authorization Transactions ---------------------------------- To enable partial authorization transactions set the partial_auth flag to true: ```PHP $sale->allow_partial_auth = true; ``` You should receive a split tender id in the response if a partial auth is made: ```PHP $split_tender_id = $response->split_tender_id; ``` Itemized Order Information -------------------------- To add itemized order information use the addLineItem method: ```PHP $auth->addLineItem( 'item1', // Item Id 'Golf tees', // Item Name 'Blue tees', // Item Description '2', // Item Quantity '5.00', // Item Unit Price 'N' // Item taxable ); ``` Merchant Defined Fields ----------------------- You can use the setCustomField method to set any custom merchant defined field(s): ```PHP $sale->setCustomField("entrance_source", "Search Engine"); $sale->setCustomField("coupon_code", "SAVE2011"); ``` Transaction Response -------------------- When you submit an AIM transaction you receive an AuthorizeNetAIM_Response object in return. You can access each name/value pair in the response as you would normally expect: ```PHP $response = $sale->authorizeAndCapture(); $response->response_code; $response->response_subcode; $response->response_reason_code; $response->transaction_id; ``` SOAP.markdown 0000644 00000000437 15107406326 0007062 0 ustar 00 SOAP ==== Basic Overview -------------- The AuthorizeNetSOAP class provides a very basic wrapper to PHP's bundled SoapClient class. The AuthorizeNetSOAP class merely contains the WSDL, Sandbox, and Live Production server urls to make it easier to connect to the Authorize.Net SOAP API. TD.markdown 0000644 00000003055 15107406326 0006626 0 ustar 00 Transaction Details API ======================= Basic Overview -------------- The AuthorizeNetTD class creates a request object for submitting requests to the Authorize.Net Transaction Details API. The AuthorizeNetTD class returns a response that uses PHP's bundled SimpleXML class for accessing it's members. The AuthorizeNetTD response provides two ways to access response elements: 1.) A SimpleXml object: ```PHP $response->xml->transaction->payment->creditCard->cardType ``` 2.) Xpath: ```PHP $batches = $response->xpath("batchList/batch"); ``` 3.) AuthorizeNet Objects (todo) Get Transaction Details ----------------------- ```PHP $request = new AuthorizeNetTD; $response = $request->getTransactionDetails($transId); echo "Amount: {$response->xml->transaction->authAmount}"; ``` Get Settled Batch List ---------------------- ```PHP $request = new AuthorizeNetTD; $response = $request->getSettledBatchList(); $batches = $response->xpath("batchList/batch"); echo "Batch 1: {$batches[0]->batchId}"; ``` Get Transaction List -------------------- ```PHP $request = new AuthorizeNetTD; $response = $request->getTransactionList($batch_id); $transactions = $response->xpath("transactions/transaction") ``` There are two additional helper methods in the PHP SDK which will make multiple calls to retrieve a day's worth of transactions or a month's worth of batches: ```PHP getTransactionsForDay($month, $day, $year = false) getSettledBatchListForMonth($month , $year) ``` If you don't pass parameters into these methods they will default to the current day/month. CIM.markdown 0000644 00000017404 15107406326 0006732 0 ustar 00 CIM API ======= Basic Overview -------------- The AuthorizeNetCIM class creates a request object for submitting transactions to the Authorize.Net CIM API. Creating a Customer Profile --------------------------- To create a new cusomter profile, first create a new AuthorizeNetCustomer object. ```PHP $customerProfile = new AuthorizeNetCustomer; $customerProfile->description = "Description of customer"; $customerProfile->merchantCustomerId = 123; $customerProfile->email = "user@domain.com"; ``` You can then create an add payment profiles and addresses to this customer object. ```PHP // Add payment profile. $paymentProfile = new AuthorizeNetPaymentProfile; $paymentProfile->customerType = "individual"; $paymentProfile->payment->creditCard->cardNumber = "4111111111111111"; $paymentProfile->payment->creditCard->expirationDate = "2015-10"; $customerProfile->paymentProfiles[] = $paymentProfile; // Add another payment profile. $paymentProfile2 = new AuthorizeNetPaymentProfile; $paymentProfile2->customerType = "business"; $paymentProfile2->payment->bankAccount->accountType = "businessChecking"; $paymentProfile2->payment->bankAccount->routingNumber = "121042882"; $paymentProfile2->payment->bankAccount->accountNumber = "123456789123"; $paymentProfile2->payment->bankAccount->nameOnAccount = "Jane Doe"; $paymentProfile2->payment->bankAccount->echeckType = "WEB"; $paymentProfile2->payment->bankAccount->bankName = "Pandora Bank"; $customerProfile->paymentProfiles[] = $paymentProfile2; // Add shipping address. $address = new AuthorizeNetAddress; $address->firstName = "john"; $address->lastName = "Doe"; $address->company = "John Doe Company"; $address->address = "1 Main Street"; $address->city = "Boston"; $address->state = "MA"; $address->zip = "02412"; $address->country = "USA"; $address->phoneNumber = "555-555-5555"; $address->faxNumber = "555-555-5556"; $customerProfile->shipToList[] = $address; // Add another shipping address. $address2 = new AuthorizeNetAddress; $address2->firstName = "jane"; $address2->lastName = "Doe"; $address2->address = "11 Main Street"; $address2->city = "Boston"; $address2->state = "MA"; $address2->zip = "02412"; $address2->country = "USA"; $address2->phoneNumber = "555-512-5555"; $address2->faxNumber = "555-523-5556"; $customerProfile->shipToList[] = $address2; ``` Next, create an AuthorizeNetCIM object: ```PHP $request = new AuthorizeNetCIM; ``` Finally, call the createCustomerProfile method and pass in your customer object: ```PHP $response = $request->createCustomerProfile($customerProfile); ``` The response object provides some helper methods for easy access to the results of the transaction: ```PHP $new_customer_id = $response->getCustomerProfileId(); ``` The response object also stores the XML response as a SimpleXml element which you can access like so: ```PHP $new_customer_id = $response->xml->customerProfileId ``` You can also run xpath queries against the result: ```PHP $array = $response->xpath('customerProfileId'); $new_customer_id = $array[0]; ``` Deleting a Customer Profile --------------------------- To delete a customer profile first create a new AuthorizeNetCIM object: ```PHP $request = new AuthorizeNetCIM; ``` Then call the deleteCustomerProfile method: ```PHP request->deleteCustomerProfile($customer_id); ``` Retrieving a Customer Profile ----------------------------- To retrieve a customer profile call the getCustomerProfile method: ```PHP $response = $request->getCustomerProfile($customerProfileId); ``` Validation Mode --------------- Validation mode allows you to generate a test transaction at the time you create a customer profile. In Test Mode, only field validation is performed. In Live Mode, a transaction is generated and submitted to the processor with the amount of $0.00 or $0.01. If successful, the transaction is immediately voided. To create a customer profile with Validation mode, simply pass in the a value for the validation mode parameter on the createCustomerProfile method: ```PHP $response = $request->createCustomerProfile($customerProfile, "testMode"); ``` You can access the validation response for each payment profile via xpath, the SimpleXML element or the getValidationResponses method: ```PHP $validationResponses = $response->getValidationResponses(); foreach ($validationResponses as $vr) { echo $vr->approved; } ``` Updating a Customer Profile --------------------------- Call the updateCustomerProfile method with the customerProfileId and customerProfile parameters: ```PHP $response = $request->updateCustomerProfile($customerProfileId, $customerProfile); ``` Adding a Payment Profile ------------------------ ```PHP $paymentProfile = new AuthorizeNetPaymentProfile; $paymentProfile->customerType = "individual"; $paymentProfile->payment->creditCard->cardNumber = "4111111111111111"; $paymentProfile->payment->creditCard->expirationDate = "2015-10"; $response = $request->createCustomerPaymentProfile($customerProfileId, $paymentProfile); ``` Updating a Payment Profile -------------------------- ```PHP $paymentProfile->payment->creditCard->cardNumber = "4111111111111111"; $paymentProfile->payment->creditCard->expirationDate = "2017-11"; $response = $request->updateCustomerPaymentProfile($customerProfileId,$paymentProfileId, $paymentProfile); ``` Adding a Shipping Address ------------------------- ```PHP $address = new AuthorizeNetAddress; $address->firstName = "john"; $address->lastName = "Doe"; $address->company = "John Doe Company"; $address->address = "1 Main Street"; $address->city = "Boston"; $address->state = "MA"; $address->zip = "02412"; $address->country = "USA"; $address->phoneNumber = "555-555-5555"; $address->faxNumber = "555-555-5556"; $response = $request->createCustomerShippingAddress($customerProfileId, $address); $customerAddressId = $response->getCustomerAddressId(); ``` Updating a Shipping Address --------------------------- ```PHP // Update shipping address. $address->address = "2 First Street"; $response = $request->updateCustomerShippingAddress($customerProfileId, $customerAddressId, $address); ``` Creating Transactions --------------------- ```PHP // Create Auth & Capture Transaction $transaction = new AuthorizeNetTransaction; $transaction->amount = "9.79"; $transaction->customerProfileId = $customerProfileId; $transaction->customerPaymentProfileId = $paymentProfileId; $transaction->customerShippingAddressId = $customerAddressId; $lineItem = new AuthorizeNetLineItem; $lineItem->itemId = "4"; $lineItem->name = "Cookies"; $lineItem->description = "Chocolate Chip"; $lineItem->quantity = "4"; $lineItem->unitPrice = "1.00"; $lineItem->taxable = "true"; $lineItem2 = new AuthorizeNetLineItem; $lineItem2->itemId = "4"; $lineItem2->name = "Cookies"; $lineItem2->description= "Peanut Butter"; $lineItem2->quantity = "4"; $lineItem2->unitPrice = "1.00"; $lineItem2->taxable = "true"; $transaction->lineItems[] = $lineItem; $transaction->lineItems[] = $lineItem2; $response = $request->createCustomerProfileTransaction("AuthCapture", $transaction); $transactionResponse = $response->getTransactionResponse(); $transactionId = $transactionResponse->transaction_id; ``` Voiding a Transaction --------------------- ```PHP $transaction = new AuthorizeNetTransaction; $transaction->transId = $transactionId; $response = $request->createCustomerProfileTransaction("Void", $transaction); ``` Deleting a Shipping Address --------------------------- ```PHP $response = $request->deleteCustomerShippingAddress($customerProfileId, $customerAddressId); ``` Deleting a Payment Profile -------------------------- ```PHP $response = $request->deleteCustomerPaymentProfile($customerProfileId, $paymentProfileId); ``` Getting Customer Profile IDs ---------------------------- ```PHP $response = $request->getCustomerProfileIds(); ```