本文整理匯總了PHP中Transfer::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP Transfer::create方法的具體用法?PHP Transfer::create怎麽用?PHP Transfer::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Transfer
的用法示例。
在下文中一共展示了Transfer::create方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testTransferUpdateMetadataAll
public function testTransferUpdateMetadataAll()
{
$recipient = self::createTestRecipient();
self::authorizeFromEnv();
$transfer = Transfer::create(array('amount' => 100, 'currency' => 'usd', 'recipient' => $recipient->id));
$transfer->metadata = array('test' => 'foo bar');
$transfer->save();
$updatedTransfer = Transfer::retrieve($transfer->id);
$this->assertSame('foo bar', $updatedTransfer->metadata['test']);
}
示例2: createTestTransfer
/**
* Create a valid test charge.
*/
protected static function createTestTransfer(array $attributes = array())
{
self::authorizeFromEnv();
$recipient = self::createTestRecipient();
return Transfer::create($attributes + array('amount' => 2000, 'currency' => 'usd', 'description' => 'Transfer to test@example.com', 'recipient' => $recipient->id));
}
示例3: log
private function log($source, $destination, $amount)
{
Transfer::create(array('source_account_number' => $source->d()->number, 'destination_account_number' => $destination->d()->number, 'amount' => $amount, 'user_id' => USER_ID, 'created' => new DateTime()));
}