|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace TransactPRO\Gate\Builders; |
| 4 | + |
| 5 | +class InitA2ADataBuilder extends InitDataBuilder |
| 6 | +{ |
| 7 | + public function build() |
| 8 | + { |
| 9 | + return array( |
| 10 | + 'rs' => $this->getField('rs'), |
| 11 | + 'merchant_transaction_id' => $this->getField('merchant_transaction_id'), |
| 12 | + 'user_ip' => $this->getField('user_ip', $this->getRemoteAddress()), |
| 13 | + 'description' => $this->getField('description'), |
| 14 | + 'amount' => $this->getField('amount'), |
| 15 | + 'currency' => $this->getField('currency'), |
| 16 | + 'name_on_card' => $this->getField('name_on_card'), |
| 17 | + 'street' => $this->getField('street'), |
| 18 | + 'zip' => $this->getField('zip'), |
| 19 | + 'city' => $this->getField('city'), |
| 20 | + 'country' => $this->getField('country'), |
| 21 | + 'state' => $this->getField('state', 'NA'), |
| 22 | + 'email' => $this->getField('email'), |
| 23 | + 'phone' => $this->getField('phone'), |
| 24 | + 'card_bin' => $this->getField('card_bin'), |
| 25 | + 'bin_name' => $this->getField('bin_name'), |
| 26 | + 'bin_phone' => $this->getField('bin_phone'), |
| 27 | + 'merchant_site_url' => $this->getField('merchant_site_url'), |
| 28 | + 'save_card' => $this->getField('save_card'), |
| 29 | + 'cardname' => $this->getField('cardname'), |
| 30 | + 'recipient_name' => $this->getField('recipient_name'), |
| 31 | + 'client_birth_date' => $this->getField('client_birth_date'), |
| 32 | + ); |
| 33 | + } |
| 34 | + |
| 35 | + protected function checkData() |
| 36 | + { |
| 37 | + $this->checkMandatoryField('rs'); |
| 38 | + $this->checkMandatoryField('merchant_transaction_id'); |
| 39 | + $this->checkMandatoryField('amount'); |
| 40 | + $this->checkMandatoryField('currency'); |
| 41 | + $this->checkMandatoryField('name_on_card'); |
| 42 | + $this->checkMandatoryField('client_birth_date'); |
| 43 | + } |
| 44 | +} |
0 commit comments