/** * @dataProvider mockProvider * @param BankAccount $obj */ public function testCreate($obj, $mockApiContext) { $mockPayPalRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock(); $mockPayPalRestCall->expects($this->any())->method('execute')->will($this->returnValue(self::getJson())); $result = $obj->create($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); }
"country_code": "US", "postal_code": "43210", "state": "OH", "phone": "408-334-8890" }, "external_customer_id": "external_id" } */ $bankAccount = new BankAccount(); $bankAccount->setAccountNumber("4417119669820331")->setAccountNumberType("IBAN")->setAccountType("SAVINGS")->setAccountName("Ramraj")->setCheckType("PERSONAL")->setAuthType("WEB")->setBankName("CITI")->setCountryCode("US")->setFirstName("Ramraj")->setLastName("K")->setBirthDate("1987-08-13")->setExternalCustomerId(uniqid()); $billingAddress = new \PayPal\Api\Address(); $billingAddress->setLine1("52 N Main St")->setCity("Johnstown")->setState("OH")->setCountryCode("US")->setPostalCode("43210")->setPhone("408-334-8890"); $bankAccount->setBillingAddress($billingAddress); // For Sample Purposes Only. $request = clone $bankAccount; // ### Save bank account // Creates the bank account as a resource // in the PayPal vault. The response contains // an 'id' that you can use to refer to it // in future payments. // (See bootstrap.php for more on `ApiContext`) try { $bankAccount->create($apiContext); } catch (Exception $ex) { // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printError("Create Bank Account", "Bank Account", null, $request, $ex); exit(1); } // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY ResultPrinter::printResult("Create Bank Account", "Bank Account", $bankAccount->getId(), $request, $bankAccount); return $bankAccount;