Exemplo n.º 1
0
 public static function refund($id, $params)
 {
     $response = PromisePay::RestClient('patch', 'items/' . $id . '/refund', $params);
     $jsonDecodedResponse = json_decode($response, true);
     return $jsonDecodedResponse['items'];
 }
Exemplo n.º 2
0
 public static function create($params)
 {
     $response = PromisePay::RestClient('post', 'fees/', $params);
     $jsonDecodedResponse = json_decode($response, true);
     return $jsonDecodedResponse['fees'];
 }
 /**
  * Update existing company.
  * Expects Company object and company id (in form of "ec9bf096-c505-4bef-87f6-18822b9dbf2c").
  *
  * @param Company $company
  * @param string $id
  * @return array
  */
 public static function update($id, $params)
 {
     $response = PromisePay::RestClient('patch', 'companies/' . $id, $params);
     $jsonDecodedResponse = json_decode($response->raw_body, true);
     return $jsonDecodedResponse['companies'];
 }
 public static function getUser($id)
 {
     $response = PromisePay::RestClient('get', 'card_accounts/' . $id . '/users');
     $jsonDecodedResponse = json_decode($response->raw_body, true);
     return $jsonDecodedResponse['users'];
 }
Exemplo n.º 5
0
 public static function requestSessionToken($params)
 {
     $response = PromisePay::RestClient('get', 'request_session_token/', $params);
     $jsonDecodedResponse = json_decode($response->raw_body, true);
     return $jsonDecodedResponse;
 }
Exemplo n.º 6
0
 /**
  * @expectedException PromisePay\Exception\ApiUnsupportedRequestMethod
  */
 public function testInvalidRequestMethod()
 {
     PromisePay::RestClient('commit', 'items/10');
 }
Exemplo n.º 7
0
 /**
  * Request Token Auths
  *
  * == Example $params ==
  *
  * Card Token :
  * [ 'token_type' => 'card', 'user_id' => $user_id ]
  *
  * Approve token :
  * [ 'token_type' => 4, 'email' => $marketplace_users_email, 'password' => $marketplace_users_password ]
  *
  * EUI token :
  * // Not available yet
  *
  * http://reference.promisepay.com/docs/generate-a-card-token
  *
  * @since 1.2 As per https://promisepay-api.readme.io/docs/generate-a-card-token
  * @param  array $params
  * @return array JSON decoded API response
  */
 public static function requestTokenAuths($params)
 {
     $response = PromisePay::RestClient('post', 'token_auths/', $params);
     $jsonDecodedResponse = json_decode($response->raw_body, true);
     return $jsonDecodedResponse;
 }
Exemplo n.º 8
0
 public static function setDisbursementAccount($id, $params)
 {
     $response = PromisePay::RestClient('post', 'users/' . $id . '/disbursement_account', $params);
     return json_decode($response->raw_body, true);
 }
 public static function getFee($id)
 {
     $response = PromisePay::RestClient('get', 'transactions/' . $id . '/fees');
     $jsonDecodedResponse = json_decode($response->raw_body, true);
     return $jsonDecodedResponse['fees'];
 }
Exemplo n.º 10
0
 public static function get($id)
 {
     $response = PromisePay::RestClient('get', 'addresses/' . $id);
     $jsonDecodedResponse = json_decode($response->raw_body, true);
     return $jsonDecodedResponse['addresses'];
 }
Exemplo n.º 11
0
 public function get($id)
 {
     PromisePay::RestClient('get', 'fees/' . $id);
     return PromisePay::getDecodedResponse('fees');
 }