/** * Assert that a destroyed flag is set after a card is successfully destroyed. * */ public function testDestroy() { $customer = OmiseCustomer::retrieve('cust_test_4zmrjg2hct06ybwobqc'); $card = $customer->cards()->retrieve('card_test_4zmrjfzf0spz3mh63cs'); $card->destroy(); $this->assertArrayHasKey('object', $card); $this->assertEquals('card', $card['object']); $this->assertTrue($card->isDestroyed()); }
/** * Assert that a destroyed flag is set after a customer is successfully destroyed. * */ public function testDestroy() { $customer = OmiseCustomer::retrieve('cust_test_4zmrjg2hct06ybwobqc'); $customer->destroy(); $this->assertTrue($customer->isDestroyed()); }
<?php $customer = OmiseCustomer::create(array('email' => '*****@*****.**', 'description' => 'John Doe (id: 30)'));
<?php $customer = OmiseCustomer::retrieve('cust_test_4xtrb759599jsxlhkrb');
<?php $customer = OmiseCustomer::retrieve('cust_test_4xsjvylia03ur542vn6'); $card = $customer->getCards()->retrieve('card_test_4xsjw0t21xaxnuzi9gs'); # Note that you can reload the card once you have an instance of one. $card->reload();
<?php $customer = OmiseCustomer::create(array('email' => '*****@*****.**', 'description' => 'John Doe (id: 30)', 'card' => 'tokn_test_4xs9408a642a1htto8z'));
<?php $customer = OmiseCustomer::retrieve('cust_test_4ybb9ymhoi7ju6wuizb'); $cards = $customer->getCards();