関数
AmazonMiddleware::setCustomerDataWithCheckoutSession( bool $payandship )
$_POST['customer'] with Amazon checkout session dataパラメータ パラメータ
- $payandship
(bool) (必須)
ファイル: src/Routing/AmazonMiddleware.php
public function setCustomerDataWithCheckoutSession($payandship) {
return function () use ($payandship) {
if (!usces_is_login()) {
$response = $_SESSION['amazonCheckoutSession'];
$fullname = explode(' ', $response['buyer']['name']);
$name1 = $fullname[0];
$name2 = isset($fullname[1]) ? join(' ', array_slice($fullname, 1)) : '';
$entries = isset($_SESSION['usces_entry']) ? $_SESSION['usces_entry'] : [];
$_POST['customer'] = isset($entries['customer']) ? $entries['customer'] : [];
$customer = [];
$customer['name1'] = $name1;
$customer['name2'] = $name2;
$customer['mailaddress1'] = $response['buyer']['email'];
$customer['mailaddress2'] = $response['buyer']['email'];
$opts = $this->module->getActingOpts();
if ($opts['quickpay_default_customer_address_details'] === 'on' && $payandship === true) {
$delivery = $this->getDeliveryAddressFromCheckoutSession($response);
$customer['country'] = $delivery['country'];
$customer['fax'] = $delivery['fax'];
$customer['pref'] = $delivery['pref'];
$customer['tel'] = $delivery['tel'];
$customer['zipcode'] = $delivery['zipcode'];
$customer['address1'] = $delivery['address1'];
$customer['address2'] = $delivery['address2'];
$customer['address3'] = $delivery['address3'];
}
$_POST['customer'] = $customer;
}
};
}