@@ 155-164 (lines=10) @@ | ||
152 | ||
153 | } |
|
154 | ||
155 | public function sale() |
|
156 | { |
|
157 | $return = \Yii::$app->get('braintree')->singleCharge(); |
|
158 | if ($return['status'] === false) { |
|
159 | $this->addErrorFromResponse($return['result']); |
|
160 | return false; |
|
161 | } else { |
|
162 | return $return; |
|
163 | } |
|
164 | } |
|
165 | ||
166 | public function saleFromVault() |
|
167 | { |
|
@@ 166-175 (lines=10) @@ | ||
163 | } |
|
164 | } |
|
165 | ||
166 | public function saleFromVault() |
|
167 | { |
|
168 | $return = \Yii::$app->get('braintree')->singleCharge(); |
|
169 | if ($return['status'] === false) { |
|
170 | $this->addErrorFromResponse($return['result']); |
|
171 | return false; |
|
172 | } else { |
|
173 | return $return; |
|
174 | } |
|
175 | } |
|
176 | ||
177 | public function customer() |
|
178 | { |
|
@@ 177-186 (lines=10) @@ | ||
174 | } |
|
175 | } |
|
176 | ||
177 | public function customer() |
|
178 | { |
|
179 | $return = \Yii::$app->get('braintree')->saveCustomer(); |
|
180 | if ($return['status'] === false) { |
|
181 | $this->addErrorFromResponse($return['result']); |
|
182 | return false; |
|
183 | } else { |
|
184 | return $return; |
|
185 | } |
|
186 | } |
|
187 | ||
188 | public function creditCard() |
|
189 | { |
|
@@ 188-197 (lines=10) @@ | ||
185 | } |
|
186 | } |
|
187 | ||
188 | public function creditCard() |
|
189 | { |
|
190 | $return = \Yii::$app->get('braintree')->saveCreditCard(); |
|
191 | if ($return['status'] === false) { |
|
192 | $this->addErrorFromResponse($return['result']); |
|
193 | return false; |
|
194 | } else { |
|
195 | return $return; |
|
196 | } |
|
197 | } |
|
198 | ||
199 | public function address() |
|
200 | { |
|
@@ 199-208 (lines=10) @@ | ||
196 | } |
|
197 | } |
|
198 | ||
199 | public function address() |
|
200 | { |
|
201 | $return = \Yii::$app->get('braintree')->saveAddress(); |
|
202 | if ($return['status'] === false) { |
|
203 | $this->addErrorFromResponse($return['result']); |
|
204 | return false; |
|
205 | } else { |
|
206 | return $return; |
|
207 | } |
|
208 | } |
|
209 | ||
210 | /** |
|
211 | * This add error from braintree response. |