本文整理汇总了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()));
}