hayleyberryl2s/amazongiftcode
最新稳定版本:v1.1.0
Composer 安装命令:
composer require hayleyberryl2s/amazongiftcode
包简介
Laravel Package for Amazon Gift Codes.
关键字:
README 文档
README
AmazonGiftCode is Laravel package for Amazon Gift Codes On Demand (AGCOD). Integration for Amazon Incentive API. Read more at https://developer.amazon.com/amazon-incentives-api
This package will give you a simplest APIs to Create/Cancel Amazon Gift Code On Demand.
Installation
You can install this package via Composer.
$ composer require kamerk22/amazongiftcode
Set the following Environment Variable in .env file.
GIFT_CARD_ENDPOINT=agcod-v2-gamma.amazon.com GIFT_CARD_KEY=AWS_ACCESS_KEY GIFT_CARD_SECRET=AWS_SECRET GIFT_CARD_PARTNER_ID=AWS_PARTNER_ID
The package will register itself automatically. Optionally publish config file of package
$ php artisan vendor:publish --provider="kamerk22\AmazonGiftCode\AmazonGiftCodeServiceProvider" --tag="config"
Usage
To Create Amazon Gift Card
$aws = AmazonGiftCode::make()->buyGiftCard($value);
Create a Amazon Gift Card with your own $creationRequestId (otherwise generated)
$aws = AmazonGiftCode::make()->buyGiftCard($value, $creationRequestId);
To Cancel Amazon Gift Card
$aws = AmazonGiftCode::make()->cancelGiftCard($creationRequestId, $gcId);
To Get Available Funds Balance
$aws = AmazonGiftCode::make()->getAvailableFunds();
Available Methods
To change client configuration dynamic. If you pass only $key or other parameter will takes value from default config.
$aws = AmazonGiftCode::make($key, $secret, $partner, $endpoint, $currency)->buyGiftCard($value);
CreateGiftCard
getStatus()
Get the status of perform request. (status)
$status = $aws->getStatus();
getId()
To get unique Amazon Gift Card id. (gcId)
$gcId = $aws->getId();
getCreationRequestId()
Original Creation Request Id. (creationRequestId)
$creationRequestId = $aws->getCreationRequestId();
getClaimCode()
Amazon Gift Card Claim Code to be used. (gcClaimCode)
$gcClaimCode = $aws->getClaimCode();
getValue()
Amount of generated Gift Card. (amount)
$amount = $aws->getValue();
getCurrency()
Currency Code of generated Gift Card. (currencyCode)
$currencyCode = $aws->getCurrency();
getRawJson()
Get the raw JSON response. (original response)
$rawJson = $aws->getRawJson();
CancelGiftCard
getStatus()
Get the status of perform request. (status)
$status = $aws->getStatus();
getId()
To get unique Amazon Gift Card id. (gcId)
$gcId = $aws->getId();
getCreationRequestId()
Original Creation Request Id. (creationRequestId)
$creationRequestId = $aws->getCreationRequestId();
getRawJson()
Get the raw JSON response. (original response)
$rawJson = $aws->getRawJson();
GetAvailableFunds
getStatus()
Get the status of perform request. (status)
$status = $aws->getStatus();
getAmount()
To get available balance amount. (amount)
$amount = $aws->getAmount();
getCurrency()
To get currency. (currency)
$currency = $aws->getCurrency();
getTimestamp()
Get request timestamp. (getTimestamp)
$timestamp = $aws->getTimestamp();
getRawJson()
Get the raw JSON response. (original response)
$rawJson = $aws->getRawJson();
Change log
Please see the changelog for more information on what has changed recently.
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email kashyapk62@gmail.com instead of using the issue tracker.
Credits
License
MIT. Please see the license file for more information.
统计信息
- 总下载量: 2.72k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-05-17