Exemple #1
0
 public static function createOneTimeBankUsingCredentials(Credentials $credentials, $attributes = array())
 {
     $conn = new Connection($credentials);
     $attributes['type'] = 'bank';
     $response = $conn->post('/tokens', $attributes);
     return new self($response, $conn);
 }
Exemple #2
0
 public static function createUsingCredentials(Credentials $credentials, $paymentMethod, $amount, $params = array())
 {
     $conn = new Connection($credentials);
     $params['amount'] = $amount;
     if ($paymentMethod instanceof PaymentMethodReference) {
         $params['method'] = $paymentMethod->id;
     } else {
         $params['method'] = $paymentMethod->attributes;
     }
     $response = $conn->post('/credits', $params);
     return new self($response, $conn);
 }
Exemple #3
0
 public static function findByIdUsingCredentials(Credentials $credentials, $id)
 {
     $conn = new Connection($credentials);
     $response = $conn->get('/transactions/' . $id);
     return self::parse($response, $conn);
 }
Exemple #4
0
 public static function findCurrentUsingCredentials(Credentials $credentials)
 {
     $conn = new Connection($credentials);
     $response = $conn->get('/merchant');
     return new self($response, $conn);
 }
Exemple #5
0
 public static function findByIdUsingCredentials(Credentials $credentials, $id)
 {
     $conn = new Connection($credentials);
     $response = $conn->get('/cards/' . $id);
     return new self($response, $conn);
 }
Exemple #6
0
 public static function allHoldsUsingCredentials(Credentials $credentials, $params = array())
 {
     $conn = new Connection($credentials);
     $response = $conn->get('/charges/holds', $params);
     return new TransactionList($response, $conn);
 }