Esempio n. 1
0
 public static function createOneTimeBankUsingCredentials($credentials, $attributes = array())
 {
     $conn = new ChargeIO_Connection($credentials);
     $attributes['type'] = 'bank';
     $response = $conn->post('/tokens', $attributes);
     return new ChargeIO_OneTimeToken($response, $conn);
 }
Esempio n. 2
0
 public static function createUsingCredentials($credentials, $paymentMethod, $amount, $params = array())
 {
     $conn = new ChargeIO_Connection($credentials);
     $params['amount'] = $amount;
     if ($paymentMethod instanceof ChargeIO_PaymentMethodReference) {
         $params['method'] = $paymentMethod->id;
     } else {
         $params['method'] = $paymentMethod->attributes;
     }
     $response = $conn->post('/credits', $params);
     return new ChargeIO_Credit($response, $conn);
 }
Esempio n. 3
0
 public static function findByIdUsingCredentials($credentials, $id)
 {
     $conn = new ChargeIO_Connection($credentials);
     $response = $conn->get('/cards/' . $id);
     return new ChargeIO_Card($response, $conn);
 }
Esempio n. 4
0
 public static function findByIdUsingCredentials($credentials, $id)
 {
     $conn = new ChargeIO_Connection($credentials);
     $response = $conn->get('/transactions/' . $id);
     return self::parse($response, $conn);
 }
Esempio n. 5
0
 public static function allHoldsUsingCredentials($credentials, $params = array())
 {
     $conn = new ChargeIO_Connection($credentials);
     $response = $conn->get('/charges/holds', $params);
     return new ChargeIO_TransactionList($response, $conn);
 }
Esempio n. 6
0
 public static function findCurrentUsingCredentials($credentials)
 {
     $conn = new ChargeIO_Connection($credentials);
     $response = $conn->get('/merchant');
     return new ChargeIO_Merchant($response, $conn);
 }