Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for Zend Guard Encoder)
- *
- * @ Version : 3.0.4.0
- * @ Author : DeZender
- * @ Release on : 02.04.2017
- * @ Official site : http://DeZender.Net
- *
- */
- namespace Gate\Squareup;
- class SquareupGateway extends Gate\Common\Gateway
- {
- public function __construct()
- {
- parent::__construct('squareup');
- }
- public function purchase()
- {
- $access_token = $this->getPersonalAccessToken();
- $request = new Libs\SquareConnect\Api\Location($access_token);
- $locations = $request->getLocations();
- if (!empty($locations)) {
- $transaction = new Libs\SquareConnect\Api\TransactionApi($access_token, $request->getLocationId(), $this->getPurchaseOptions());
- return $transaction->getStatus();
- }
- }
- public function getPurchaseOptions()
- {
- $idempotencyKey = uniqid();
- return array(
- 'idempotency_key' => $idempotencyKey,
- 'shipping_address' => array('address_line_1' => $this->getAddress(), 'locality' => $this->getCity(), 'administrative_district_level_1' => $this->getState(), 'postal_code' => $this->getPostalCode(), 'country' => $this->getCountry()),
- 'billing_address' => array('address_line_1' => $this->getAddress(), 'address_line_2' => $this->getAddress(), 'administrative_district_level_1' => $this->getState(), 'locality' => $this->getCity(), 'postal_code' => $this->getPostalCode(), 'country' => $this->getCountry()),
- 'amount_money' => array('amount' => $this->getAmount(), 'currency' => $this->getCurrency()),
- 'card_nonce' => $this->getCardNonse(),
- 'reference_id' => $this->getHash(),
- ...........................................................................
- .......................................
- ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement