public function testFromDeposit() { $deposit = new Deposit(); $deposit->setAmount(new Money(10, CurrencyCode::USD)); $deposit->setPaymentMethod(new PaymentMethod('PAYMENT_METHOD_ID')); $data = $this->mapper->fromDeposit($deposit); $this->assertEquals(['amount' => '10', 'currency' => 'USD', 'payment_method' => 'PAYMENT_METHOD_ID'], $data); }
public function testCommitDeposit() { $deposit = Deposit::reference('ACCOUNT_ID', 'DEPOSIT_ID'); $response = $this->getMock(ResponseInterface::class); $this->http->expects($this->once())->method('post')->with('/v2/accounts/ACCOUNT_ID/deposits/DEPOSIT_ID/commit', ['foo' => 'bar'])->willReturn($response); $this->mapper->expects($this->once())->method('toDeposit')->with($response, $deposit); $this->client->commitDeposit($deposit, ['foo' => 'bar']); }