allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
This commit is contained in:
76
vendor/omnipay/stripe/src/Message/PurchaseRequest.php
vendored
Normal file
76
vendor/omnipay/stripe/src/Message/PurchaseRequest.php
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Stripe Purchase Request.
|
||||
*/
|
||||
namespace Omnipay\Stripe\Message;
|
||||
|
||||
/**
|
||||
* Stripe Purchase Request.
|
||||
*
|
||||
* To charge a credit card, you create a new charge object. If your API key
|
||||
* is in test mode, the supplied card won't actually be charged, though
|
||||
* everything else will occur as if in live mode. (Stripe assumes that the
|
||||
* charge would have completed successfully).
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* <code>
|
||||
* // Create a gateway for the Stripe Gateway
|
||||
* // (routes to GatewayFactory::create)
|
||||
* $gateway = Omnipay::create('Stripe');
|
||||
*
|
||||
* // Initialise the gateway
|
||||
* $gateway->initialize(array(
|
||||
* 'apiKey' => 'MyApiKey',
|
||||
* ));
|
||||
*
|
||||
* // Create a credit card object
|
||||
* // This card can be used for testing.
|
||||
* $card = new CreditCard(array(
|
||||
* 'firstName' => 'Example',
|
||||
* 'lastName' => 'Customer',
|
||||
* 'number' => '4242424242424242',
|
||||
* 'expiryMonth' => '01',
|
||||
* 'expiryYear' => '2020',
|
||||
* 'cvv' => '123',
|
||||
* 'email' => 'customer@example.com',
|
||||
* 'billingAddress1' => '1 Scrubby Creek Road',
|
||||
* 'billingCountry' => 'AU',
|
||||
* 'billingCity' => 'Scrubby Creek',
|
||||
* 'billingPostcode' => '4999',
|
||||
* 'billingState' => 'QLD',
|
||||
* ));
|
||||
*
|
||||
* // Do a purchase transaction on the gateway
|
||||
* $transaction = $gateway->purchase(array(
|
||||
* 'amount' => '10.00',
|
||||
* 'currency' => 'USD',
|
||||
* 'description' => 'This is a test purchase transaction.',
|
||||
* 'card' => $card,
|
||||
* ));
|
||||
* $response = $transaction->send();
|
||||
* if ($response->isSuccessful()) {
|
||||
* echo "Purchase transaction was successful!\n";
|
||||
* $sale_id = $response->getTransactionReference();
|
||||
* echo "Transaction reference = " . $sale_id . "\n";
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
* Because a purchase request in Stripe looks similar to an
|
||||
* Authorize request, this class simply extends the AuthorizeRequest
|
||||
* class and over-rides the getData method setting capture = true.
|
||||
*
|
||||
* @see \Omnipay\Stripe\Gateway
|
||||
* @link https://stripe.com/docs/api#charges
|
||||
*/
|
||||
class PurchaseRequest extends AuthorizeRequest
|
||||
{
|
||||
public function getData()
|
||||
{
|
||||
$data = parent::getData();
|
||||
$data['capture'] = 'true';
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user