Skip to content

Commit

Permalink
Fixed person type in json payload
Browse files Browse the repository at this point in the history
  • Loading branch information
SparK-Cruz committed Feb 22, 2017
1 parent bc0085a commit 5b4dd7a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions woocommerce-gateway-ebanx/includes/class-wc-ebanx-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ protected function request_data($order)
$newData = array();
$newData['payment'] = array();

$newData['payment']['person_type'] = 'personal';
$newData['payment']['person_type'] = $person_type;

if (!empty($_POST['ebanx_billing_document'])) {
$newData['payment']['document'] = $_POST['ebanx_billing_document'];
Expand Down Expand Up @@ -444,8 +444,7 @@ protected function request_data($order)

if ($this->getTransactionAddress('country') === WC_EBANX_Gateway_Utils::COUNTRY_BRAZIL) {

if ($is_cnpj) {
$newData['payment']['person_type'] = 'business';
if ($person_type == 'business') {
$newData['payment']['responsible'] = array(
"name" => $data['payment']['name']
);
Expand Down

0 comments on commit 5b4dd7a

Please sign in to comment.