public function testSave() { Stripe::setApiKey('sk_test_JieJALRz7rPz7boV17oMma7a'); $s = Source::create(array('type' => 'bitcoin', 'currency' => 'usd', 'amount' => '100', 'owner[email]' => '*****@*****.**')); $this->assertSame('bitcoin', $s->type); $source = Source::retrieve($s->id); $this->assertSame(100, $source->amount); }
public function testVerify() { $response = array('id' => 'src_foo', 'object' => 'source', 'verification' => array('status' => 'pending')); $this->mockRequest('GET', '/v1/sources/src_foo', array(), $response); $response['verification']['status'] = 'succeeded'; $this->mockRequest('POST', '/v1/sources/src_foo/verify', array('values' => array(32, 45)), $response); $source = Source::retrieve('src_foo'); $this->assertSame($source->verification->status, 'pending'); $source->verify(array('values' => array(32, 45))); $this->assertSame($source->verification->status, 'succeeded'); }