Skip to content

Commit

Permalink
Merge pull request #5 from dzung2t/v2-master
Browse files Browse the repository at this point in the history
User Profile API for Opencart v2
  • Loading branch information
Roman Sevastyanov committed Jul 27, 2015
2 parents b490778 + a1eb8d8 commit b285314
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions src/catalog/controller/payment/paymentwall.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,14 @@ private function generateWidget($orderInfo)
'Order #' . $orderInfo['order_id']
)
),
array(
'email' => $orderInfo['email'],
'integration_module' => 'opencart',
'test_mode' => $this->config->get('paymentwall_test')
array_merge(
array(
'success_url' => $this->url->link('checkout/success'),
'email' => $orderInfo['email'],
'integration_module' => 'opencart',
'test_mode' => $this->config->get('paymentwall_test')
),
$this->getUserProfileData($orderInfo)
));

return $widget->getHtmlCode(array(
Expand All @@ -64,4 +68,19 @@ private function generateWidget($orderInfo)
'frameborder' => 0
));
}

private function getUserProfileData($orderInfo)
{
return array(
'customer[city]' => $orderInfo['payment_city'],
'customer[state]' => $orderInfo['payment_zone'],
'customer[address]' => $orderInfo['payment_address_1'],
'customer[country]' => $orderInfo['payment_iso_code_2'],
'customer[zip]' => $orderInfo['payment_postcode'],
'customer[username]' => $orderInfo['customer_id'] ? $orderInfo['customer_id'] : $_SERVER['REMOTE_ADDR'],
'customer[firstname]' => $orderInfo['payment_firstname'],
'customer[lastname]' => $orderInfo['payment_lastname'],
'email' => $orderInfo['email'],
);
}
}

0 comments on commit b285314

Please sign in to comment.