コード例 #1
0
 public function testListCardAccountsForUser()
 {
     // First, create the user
     $createUser = PromisePay::User()->create($this->userData);
     // Update the cardAccountData
     $this->cardAccountData['user_id'] = $createUser['id'];
     // Create the Card Account
     $createAccount = PromisePay::CardAccount()->create($this->cardAccountData);
     $user = PromisePay::CardAccount()->getUser($createAccount['id']);
     $this->assertEquals($this->cardAccountData['full_name'], $user['full_name']);
 }
コード例 #2
0
 /**
  * @group failing
  */
 public function testListUserCardAccount()
 {
     // First, create the user
     $createUser = PromisePay::User()->create($this->userData);
     // update card account data with the id of just created user
     $this->cardAccountData['user_id'] = $createUser['id'];
     // create a Card Account
     $createCardAccount = PromisePay::CardAccount()->create($this->cardAccountData);
     // Lookup Card Accounts associated with the user
     $userCardAccounts = PromisePay::User()->getListOfCardAccounts($createUser['id']);
     $this->assertEquals($this->cardAccountData['full_name'], $userCardAccounts['card']['full_name']);
 }
コード例 #3
0
ファイル: ItemTest.php プロジェクト: kublermdk/promisepay-php
 public function makePayment()
 {
     $this->buyerId = GUID();
     $this->sellerId = GUID();
     $this->GUID = GUID();
     $itemData = $this->itemData;
     $itemData['id'] = $this->GUID;
     $itemData['buyer_id'] = $this->buyerId;
     $itemData['seller_id'] = $this->sellerId;
     $userData = $this->userData;
     $userData['id'] = $this->buyerId;
     $userData['email'] = $this->buyerId . '@google.com';
     $userData['mobile'] = $this->buyerId . '123456';
     $buyerUserData = $userData;
     $cardAccountData = $this->cardAccountData;
     $cardAccountData['user_id'] = $this->buyerId;
     // Create Buyer
     $createBuyer = PromisePay::User()->create($userData);
     // Create Buyer Card Account
     $createBuyerCardAccount = PromisePay::CardAccount()->create($cardAccountData);
     // Create Seller
     $userData['id'] = $this->sellerId;
     $userData['email'] = $this->sellerId . '@google.com';
     $userData['mobile'] = $this->sellerId . '12345';
     $userData['first_name'] = 'Jane';
     $userData['last_name'] = 'Jonesy';
     $sellerUserData = $userData;
     $createSeller = PromisePay::User()->create($userData);
     // Create the item
     $createItem = PromisePay::Item()->create($itemData);
     $makePayment = PromisePay::Item()->makePayment($createItem['id'], array('account_id' => $createBuyerCardAccount['id']));
     /*
         item, buyer and seller keys contain data arrays that are not returned from API, but are generated in this test suite, and
         are passed along with the API data in order to compare what we sent to API, and what it gave back.
     */
     return array('payment' => $makePayment, 'item' => $createItem, 'buyer' => $buyerUserData, 'seller' => $sellerUserData);
 }
コード例 #4
0
 protected function createBuyerCardAccount()
 {
     $this->cardAccountData['user_id'] = $this->buyerId;
     $this->cardAccountData['full_name'] = sprintf('%s %s', $this->userData['first_name'], $this->userData['last_name']);
     return PromisePay::CardAccount()->create($this->cardAccountData);
 }