Use Checks
Overview
Place an order using catalog products, and collect the payment using Check.
Parameters
Parameters | Type/Description |
---|---|
sessionID |
Required (string) |
|
Session identifier, the output of the Login method. Include sessionID into all your requests. Avangate throws an exception if the values are incorrect. The sessionID expires in 10 minutes. |
Order |
Required (Object) |
|
Object designed to collect all data necessary for an order, including billing, product/subscription plan and payment details.
|
Workflow
- Customer places the order using Check as payment option.
- After order is confirmed, customer receives the payment instructions via e-mail, including the address to which the check should be sent.
- Order is finalized as soon as the payment is confirmed into Avangate's bank account.
Response
Parameters | Type/Description |
---|---|
Order information |
Object |
Request
<?php require ('PATH_TO_AUTH'); $Order = new stdClass(); $Order->RefNo = NULL; $Order->Currency = 'usd'; $Order->Country = 'US'; $Order->Language = 'en'; $Order->CustomerIP = '91.220.121.21'; $Order->ExternalReference = NULL; $Order->Source = NULL; $Order->AffiliateId = NULL; $Order->CustomerReference = NULL; $Order->Items = array(); $Order->Items[0] = new stdClass(); $Order->Items[0]->Code = 'my_subscription_1'; $Order->Items[0]->Quantity = 1; $Order->Items[0]->PriceOptions = NULL; $Order->Items[0]->SKU = NULL; $Order->Items[0]->Price = NULL; $Order->Items[0]->CrossSell = NULL; $Order->Items[0]->Trial = false; $Order->Items[0]->AdditionalFields = NULL; $Order->Items[0]->Promotion = NULL; $Order->BillingDetails = new stdClass(); $Order->BillingDetails->FirstName = 'FirstName'; $Order->BillingDetails->LastName = 'LastName'; $Order->BillingDetails->CountryCode = 'us'; $Order->BillingDetails->State = 'California'; $Order->BillingDetails->City = 'LA'; $Order->BillingDetails->Address1 = 'Address example'; $Order->BillingDetails->Address2 = NULL; $Order->BillingDetails->Zip = '90210'; $Order->BillingDetails->Email = 'customer@email.com'; $Order->BillingDetails->Phone = NULL; $Order->BillingDetails->Company = NULL; $Order->DeliveryDetails = NULL; $Order->PaymentDetails = new stdClass (); $Order->PaymentDetails->Type = 'CHECK'; $Order->PaymentDetails->Currency = 'USD'; $Order->PaymentDetails->PaymentMethod = new stdClass (); $Order->AdditionalFields = NULL; $Order->LocalTime = NULL; $Order->GiftDetails = NULL; try { $newOrder = $client->placeOrder($sessionID, $Order); } catch (SoapFault $e) { echo "newOrder: " . $e->getMessage(); exit; } var_dump("newOrder", $newOrder); ?>