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:
32
vendor/omnipay/stripe/tests/Message/PaymentIntents/AbstractRequestTest.php
vendored
Normal file
32
vendor/omnipay/stripe/tests/Message/PaymentIntents/AbstractRequestTest.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Omnipay\Stripe\Message\PaymentIntents;
|
||||
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use Mockery;
|
||||
use Omnipay\Tests\TestCase;
|
||||
|
||||
class AbstractRequestTest extends TestCase
|
||||
{
|
||||
/** @var AbstractRequest */
|
||||
protected $request;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->request = Mockery::mock('\Omnipay\Stripe\Message\PaymentIntents\AbstractRequest')->makePartial();
|
||||
$this->request->initialize();
|
||||
}
|
||||
|
||||
public function testPaymentIntentReference()
|
||||
{
|
||||
$this->assertSame($this->request, $this->request->setPaymentIntentReference('abc123'));
|
||||
$this->assertSame('abc123', $this->request->getPaymentIntentReference());
|
||||
}
|
||||
|
||||
public function testPaymentMethodAlternatives()
|
||||
{
|
||||
$this->request->setCardReference('card_some_card');
|
||||
$this->assertSame('card_some_card', $this->request->getCardReference());
|
||||
$this->assertSame('card_some_card', $this->request->getPaymentMethod());
|
||||
}
|
||||
}
|
||||
73
vendor/omnipay/stripe/tests/Message/PaymentIntents/AttachPaymentMethodRequestTest.php
vendored
Normal file
73
vendor/omnipay/stripe/tests/Message/PaymentIntents/AttachPaymentMethodRequestTest.php
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace Omnipay\Stripe\Message\PaymentIntents;
|
||||
|
||||
use Omnipay\Tests\TestCase;
|
||||
|
||||
class AttachPaymentMethodRequestTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->request = new AttachPaymentMethodRequest($this->getHttpClient(), $this->getHttpRequest());
|
||||
$this->request->setCustomerReference('someCustomer');
|
||||
$this->request->setPaymentMethod('pm_some_visa');
|
||||
}
|
||||
|
||||
public function testEndpoint()
|
||||
{
|
||||
$this->assertSame('https://api.stripe.com/v1/payment_methods/pm_some_visa/attach', $this->request->getEndpoint());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Omnipay\Common\Exception\InvalidRequestException
|
||||
* @expectedExceptionMessage The customerReference parameter is required
|
||||
*/
|
||||
public function testMissingCustomer()
|
||||
{
|
||||
$this->request->setCustomerReference(null);
|
||||
$this->request->setPaymentMethod(null);
|
||||
$this->request->getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Omnipay\Common\Exception\InvalidRequestException
|
||||
* @expectedExceptionMessage The paymentMethod parameter is required
|
||||
*/
|
||||
public function testMissingPaymentMethod()
|
||||
{
|
||||
$this->request->setPaymentMethod(null);
|
||||
$this->request->getData();
|
||||
}
|
||||
|
||||
public function testData()
|
||||
{
|
||||
$data = $this->request->getData();
|
||||
|
||||
$this->assertSame('someCustomer', $data['customer']);
|
||||
}
|
||||
|
||||
public function testSendSuccess()
|
||||
{
|
||||
$this->setMockHttpResponse('AttachPaymentMethodSuccess.txt');
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertTrue($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertNull($response->getTransactionReference());
|
||||
$this->assertSame('cus_3f2EpMK2kPm90g', $response->getCustomerReference());
|
||||
$this->assertSame('pm_1EUon32Tb35ankTnF6nuoRVE', $response->getCardReference());
|
||||
$this->assertNull($response->getMessage());
|
||||
}
|
||||
|
||||
public function testSendFailure()
|
||||
{
|
||||
$this->setMockHttpResponse('AttachPaymentMethodFailure.txt');
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertNull($response->getTransactionReference());
|
||||
$this->assertNull($response->getCardReference());
|
||||
$this->assertSame('This PaymentMethod was previously used without being attached to a Customer or was detached from a Customer, and may not be used again.', $response->getMessage());
|
||||
}
|
||||
}
|
||||
166
vendor/omnipay/stripe/tests/Message/PaymentIntents/AuthorizeRequestTest.php
vendored
Normal file
166
vendor/omnipay/stripe/tests/Message/PaymentIntents/AuthorizeRequestTest.php
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
|
||||
namespace Omnipay\Stripe\Message\PaymentIntents;
|
||||
|
||||
use Omnipay\Tests\TestCase;
|
||||
|
||||
class AuthorizeRequestTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var AuthorizeRequest
|
||||
*/
|
||||
private $request;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->request = new AuthorizeRequest($this->getHttpClient(), $this->getHttpRequest());
|
||||
$this->request->initialize(
|
||||
array(
|
||||
'amount' => '12.00',
|
||||
'currency' => 'USD',
|
||||
'paymentMethod' => 'pm_valid_payment_method',
|
||||
'description' => 'Order #42',
|
||||
'metadata' => array(
|
||||
'foo' => 'bar',
|
||||
),
|
||||
'applicationFee' => '1.00',
|
||||
'returnUrl' => 'complete-payment',
|
||||
'setup_future_usage' => 'off_session',
|
||||
'off_session' => false,
|
||||
'confirm' => true,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetData()
|
||||
{
|
||||
$data = $this->request->getData();
|
||||
|
||||
$this->assertSame(1200, $data['amount']);
|
||||
$this->assertSame('usd', $data['currency']);
|
||||
$this->assertSame('Order #42', $data['description']);
|
||||
$this->assertSame('manual', $data['capture_method']);
|
||||
$this->assertSame('manual', $data['confirmation_method']);
|
||||
$this->assertSame('pm_valid_payment_method', $data['payment_method']);
|
||||
$this->assertSame(array('foo' => 'bar'), $data['metadata']);
|
||||
$this->assertSame(100, $data['application_fee']);
|
||||
$this->assertSame('off_session', $data['setup_future_usage']);
|
||||
$this->assertSame('false', $data['off_session']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that providing card data won't work.
|
||||
*
|
||||
* @expectedException \Omnipay\Common\Exception\InvalidRequestException
|
||||
* @expectedExceptionMessage The paymentMethod parameter is required
|
||||
*/
|
||||
public function testDataWithCardData()
|
||||
{
|
||||
$this->request->setPaymentMethod(null);
|
||||
$this->request->setCard($this->getValidCard());
|
||||
$this->request->getData();
|
||||
}
|
||||
|
||||
public function testDataWithCardReference()
|
||||
{
|
||||
$this->request->setPaymentMethod(null);
|
||||
$this->request->setCardReference('card_visa');
|
||||
$data = $this->request->getData();
|
||||
|
||||
$this->assertSame('card_visa', $data['payment_method']);
|
||||
}
|
||||
|
||||
public function testDataWithSource()
|
||||
{
|
||||
$this->request->setPaymentMethod(null);
|
||||
$this->request->setSource('src_visa');
|
||||
$data = $this->request->getData();
|
||||
|
||||
$this->assertSame('src_visa', $data['payment_method']);
|
||||
}
|
||||
|
||||
public function testDataWithToken()
|
||||
{
|
||||
$this->request->setPaymentMethod(null);
|
||||
$this->request->setToken('tok_visa');
|
||||
$data = $this->request->getData();
|
||||
|
||||
$this->assertArrayHasKey('payment_method_data', $data);
|
||||
}
|
||||
|
||||
public function testDataWithCustomerReference()
|
||||
{
|
||||
$this->request->setCustomerReference('abc');
|
||||
$data = $this->request->getData();
|
||||
|
||||
$this->assertSame('abc', $data['customer']);
|
||||
}
|
||||
|
||||
|
||||
public function testDataWithStatementDescriptor()
|
||||
{
|
||||
$this->request->setStatementDescriptor('OMNIPAY');
|
||||
$data = $this->request->getData();
|
||||
|
||||
$this->assertSame('OMNIPAY', $data['statement_descriptor']);
|
||||
}
|
||||
|
||||
public function testDataWithDestination()
|
||||
{
|
||||
$this->request->setDestination('xyz');
|
||||
$data = $this->request->getData();
|
||||
|
||||
$this->assertSame('xyz', $data['transfer_data']['destination']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirming a payment intent without a return url would destroy the flow for 3DS 2.0,
|
||||
* so let's make sure that setting confirm to true and skipping return url is
|
||||
* not permitted.
|
||||
*
|
||||
* @expectedException \Omnipay\Common\Exception\InvalidRequestException
|
||||
* @expectedExceptionMessage The returnUrl parameter is required
|
||||
*/
|
||||
public function testReturnUrlMustBeSetWhenConfirming()
|
||||
{
|
||||
$this->request->setReturnUrl(null);
|
||||
$data = $this->request->getData();
|
||||
}
|
||||
|
||||
/**
|
||||
* If not confirming automatically, don't set the return url.
|
||||
*/
|
||||
public function testReturnUrlNotInData()
|
||||
{
|
||||
$this->request->setConfirm(false);
|
||||
$data = $this->request->getData();
|
||||
$this->assertArrayNotHasKey('return_url', $data);
|
||||
}
|
||||
|
||||
public function testSendSuccessAndRequireConfirmation()
|
||||
{
|
||||
$this->setMockHttpResponse('AuthorizeSuccess.txt');
|
||||
/** @var PaymentIntentsResponse $response */
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertTrue($response->requiresConfirmation());
|
||||
$this->assertSame('manual', $response->getCaptureMethod());
|
||||
$this->assertSame('pm_1Euf5RFSbr6xR4YAwZ5fP28B', $response->getCardReference());
|
||||
$this->assertSame('req_8PDHeZazN2LwML', $response->getRequestId());
|
||||
$this->assertSame('cus_F1UMEEnT2OBgMg', $response->getCustomerReference());
|
||||
$this->assertNull($response->getMessage());
|
||||
}
|
||||
|
||||
public function testSendError()
|
||||
{
|
||||
$this->setMockHttpResponse('AuthorizeFailure.txt');
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertNull($response->getCardReference());
|
||||
$this->assertSame('No such payment_method: pm_invalid_method', $response->getMessage());
|
||||
}
|
||||
}
|
||||
59
vendor/omnipay/stripe/tests/Message/PaymentIntents/CancelPaymentIntentRequestTest.php
vendored
Normal file
59
vendor/omnipay/stripe/tests/Message/PaymentIntents/CancelPaymentIntentRequestTest.php
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace Omnipay\Stripe\Message\PaymentIntents;
|
||||
|
||||
use Omnipay\Tests\TestCase;
|
||||
|
||||
class CancelPaymentIntentRequestTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->request = new CancelPaymentIntentRequest($this->getHttpClient(), $this->getHttpRequest());
|
||||
$this->request->setPaymentIntentReference('pi_valid_intent');
|
||||
}
|
||||
|
||||
public function testEndpoint()
|
||||
{
|
||||
$this->assertSame('https://api.stripe.com/v1/payment_intents/pi_valid_intent/cancel', $this->request->getEndpoint());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Omnipay\Common\Exception\InvalidRequestException
|
||||
* @expectedExceptionMessage The paymentIntentReference parameter is required
|
||||
*/
|
||||
public function testPaymentIntent()
|
||||
{
|
||||
$this->request->setPaymentIntentReference(null);
|
||||
$this->request->getData();
|
||||
}
|
||||
|
||||
public function testData()
|
||||
{
|
||||
$this->assertEmpty($this->request->getData());
|
||||
}
|
||||
|
||||
public function testCancelSuccess()
|
||||
{
|
||||
$this->setMockHttpResponse('CancelPaymentIntentSuccess.txt');
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertTrue($response->isCancelled());
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertSame('ch_1F4OqH2okp6n5dKoWlN61H9w', $response->getTransactionReference());
|
||||
$this->assertSame('pm_1F4Oq02okp6n5dKoKfHmMyJN', $response->getCardReference());
|
||||
$this->assertNull($response->getMessage());
|
||||
}
|
||||
|
||||
public function testCancelFailure()
|
||||
{
|
||||
$this->setMockHttpResponse('CancelPaymentIntentFailure.txt');
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertFalse($response->isCancelled());
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertNull($response->getTransactionReference());
|
||||
$this->assertSame('You cannot cancel this PaymentIntent because it has a status of canceled. Only a PaymentIntent with one of the following statuses may be canceled: requires_payment_method, requires_capture, requires_confirmation, requires_action.', $response->getMessage());
|
||||
}
|
||||
}
|
||||
54
vendor/omnipay/stripe/tests/Message/PaymentIntents/CaptureRequestTest.php
vendored
Normal file
54
vendor/omnipay/stripe/tests/Message/PaymentIntents/CaptureRequestTest.php
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Omnipay\Stripe\Message\PaymentIntents;
|
||||
|
||||
use Omnipay\Tests\TestCase;
|
||||
|
||||
class CaptureRequestTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->request = new CaptureRequest($this->getHttpClient(), $this->getHttpRequest());
|
||||
$this->request->setPaymentIntentReference('pi_valid_intent');
|
||||
}
|
||||
|
||||
public function testEndpoint()
|
||||
{
|
||||
$this->assertSame('https://api.stripe.com/v1/payment_intents/pi_valid_intent/capture', $this->request->getEndpoint());
|
||||
}
|
||||
|
||||
public function testAmount()
|
||||
{
|
||||
// default is no amount
|
||||
$this->assertArrayNotHasKey('amount', $this->request->getData());
|
||||
|
||||
$this->request->setAmount('10.00');
|
||||
|
||||
$data = $this->request->getData();
|
||||
$this->assertSame(1000, $data['amount_to_capture']);
|
||||
}
|
||||
|
||||
public function testSendSuccess()
|
||||
{
|
||||
$this->setMockHttpResponse('CaptureSuccess.txt');
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertTrue($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertSame('ch_1EZvfwFSbr6xR4YAWulsIcYV', $response->getTransactionReference());
|
||||
$this->assertSame('pm_1EZvfYFSbr6xR4YAGMpD5hNj', $response->getCardReference());
|
||||
$this->assertNull($response->getMessage());
|
||||
}
|
||||
|
||||
public function testSendError()
|
||||
{
|
||||
$this->setMockHttpResponse('CaptureFailure.txt');
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertNull($response->getTransactionReference());
|
||||
$this->assertNull($response->getCardReference());
|
||||
$this->assertSame('This PaymentIntent could not be captured because it has already been captured.', $response->getMessage());
|
||||
}
|
||||
}
|
||||
72
vendor/omnipay/stripe/tests/Message/PaymentIntents/ConfirmPaymentIntentRequestTest.php
vendored
Normal file
72
vendor/omnipay/stripe/tests/Message/PaymentIntents/ConfirmPaymentIntentRequestTest.php
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace Omnipay\Stripe\Message\PaymentIntents;
|
||||
|
||||
use Omnipay\Tests\TestCase;
|
||||
|
||||
class ConfirmPaymentIntentRequestTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->request = new ConfirmPaymentIntentRequest($this->getHttpClient(), $this->getHttpRequest());
|
||||
$this->request->setPaymentIntentReference('pi_valid_intent');
|
||||
$this->request->setReturnUrl('complete-payment-page');
|
||||
}
|
||||
|
||||
public function testEndpoint()
|
||||
{
|
||||
$this->assertSame('https://api.stripe.com/v1/payment_intents/pi_valid_intent/confirm', $this->request->getEndpoint());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Omnipay\Common\Exception\InvalidRequestException
|
||||
* @expectedExceptionMessage The paymentIntentReference parameter is required
|
||||
*/
|
||||
public function testPaymentIntent()
|
||||
{
|
||||
$this->request->setPaymentIntentReference(null);
|
||||
$this->request->getData();
|
||||
}
|
||||
|
||||
public function testRedirectUrl()
|
||||
{
|
||||
$data = $this->request->getData();
|
||||
|
||||
$this->assertSame('complete-payment-page', $data['return_url']);
|
||||
}
|
||||
|
||||
public function testConfirmSuccess()
|
||||
{
|
||||
$this->setMockHttpResponse('ConfirmIntentSuccess.txt');
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertTrue($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertSame('ch_1Ev0a3FSbr6xR4YApjrlyFGi', $response->getTransactionReference());
|
||||
$this->assertSame('pm_1Ev0ZyFSbr6xR4YAX3vLBqEC', $response->getCardReference());
|
||||
$this->assertNull($response->getMessage());
|
||||
}
|
||||
|
||||
public function testConfirmMissingRedirect()
|
||||
{
|
||||
$this->setMockHttpResponse('ConfirmIntentMissingRedirect.txt');
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertSame('pm_1Ev1CcFSbr6xR4YAuKuJgwEs', $response->getCardReference());
|
||||
}
|
||||
|
||||
public function testConfirm3dsRedirect()
|
||||
{
|
||||
$this->setMockHttpResponse('ConfirmIntent3dsRedirect.txt');
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertTrue($response->isRedirect());
|
||||
$redirectUrl = 'https://hooks.stripe.com/3d_secure_2_eap/begin_test/src_1Ev1M5FSbr6xR4YAg5qdBN6B/src_client_secret_FPr4a6wAiVNi6YrnuI7vah6H';
|
||||
$this->assertSame($redirectUrl, $response->getRedirectUrl());
|
||||
$this->assertSame('pm_1Ev1LzFSbr6xR4YA0TZ8jta0', $response->getCardReference());
|
||||
}
|
||||
|
||||
}
|
||||
119
vendor/omnipay/stripe/tests/Message/PaymentIntents/CreatePaymentMethodRequestTest.php
vendored
Normal file
119
vendor/omnipay/stripe/tests/Message/PaymentIntents/CreatePaymentMethodRequestTest.php
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
namespace Omnipay\Stripe\Message\PaymentIntents;
|
||||
|
||||
use Omnipay\Tests\TestCase;
|
||||
|
||||
class CreatePaymentMethodRequestTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->request = new CreatePaymentMethodRequest($this->getHttpClient(), $this->getHttpRequest());
|
||||
$this->request->setCard($this->getValidCard());
|
||||
}
|
||||
|
||||
public function testEndpoint()
|
||||
{
|
||||
$this->assertSame('https://api.stripe.com/v1/payment_methods', $this->request->getEndpoint());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Omnipay\Common\Exception\InvalidRequestException
|
||||
* @expectedExceptionMessage The card parameter is required
|
||||
*/
|
||||
public function testCard()
|
||||
{
|
||||
$this->request->setCard(null);
|
||||
$this->request->getData();
|
||||
}
|
||||
|
||||
public function testDataWithToken()
|
||||
{
|
||||
$this->request->setToken('xyz');
|
||||
$data = $this->request->getData();
|
||||
|
||||
$this->assertSame('xyz', $data['card']['token']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Impossible to use a card reference.
|
||||
*
|
||||
* @expectedException \Omnipay\Common\Exception\InvalidRequestException
|
||||
* @expectedExceptionMessage The card parameter is required
|
||||
*/
|
||||
public function testDataWithCardReference()
|
||||
{
|
||||
$this->request->setCard(null);
|
||||
$this->request->setCardReference('xyz');
|
||||
$data = $this->request->getData();
|
||||
|
||||
$this->assertSame('xyz', $data['source']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Impossible to use a source reference.
|
||||
*
|
||||
* @expectedException \Omnipay\Common\Exception\InvalidRequestException
|
||||
* @expectedExceptionMessage The card parameter is required
|
||||
*/
|
||||
public function testDataWithSource()
|
||||
{
|
||||
$this->request->setCard(null);
|
||||
$this->request->setSource('xyz');
|
||||
$data = $this->request->getData();
|
||||
|
||||
$this->assertSame('xyz', $data['source']);
|
||||
}
|
||||
|
||||
public function testNoBillingDetails()
|
||||
{
|
||||
$this->request->setCard(null);
|
||||
$this->request->setToken('xyz');
|
||||
$this->request->getData();
|
||||
}
|
||||
|
||||
public function testDataWithCard()
|
||||
{
|
||||
$card = $this->getValidCard();
|
||||
$this->request->setCard($card);
|
||||
$data = $this->request->getData();
|
||||
|
||||
$this->assertSame($card['number'], $data['card']['number']);
|
||||
$this->assertSame($card['billingAddress1'], $data['billing_details']['address']['line1']);
|
||||
$this->assertSame($card['firstName'] . ' ' . $card['lastName'], $data['billing_details']['name']);
|
||||
}
|
||||
|
||||
public function testSendSuccess()
|
||||
{
|
||||
$this->setMockHttpResponse('CreatePaymentMethodSuccess.txt');
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertTrue($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertNull($response->getTransactionReference());
|
||||
$this->assertSame(null, $response->getCustomerReference());
|
||||
$this->assertSame('pm_1EUon32Tb35ankTnF6nuoRVE', $response->getCardReference());
|
||||
$this->assertNull($response->getMessage());
|
||||
}
|
||||
|
||||
public function testSendFailure()
|
||||
{
|
||||
$this->setMockHttpResponse('CreatePaymentMethodFailure.txt');
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertNull($response->getTransactionReference());
|
||||
$this->assertNull($response->getCardReference());
|
||||
$this->assertSame('Invalid integer: xyz', $response->getMessage());
|
||||
}
|
||||
|
||||
public function testCardWithoutEmail()
|
||||
{
|
||||
$card = $this->getValidCard();
|
||||
$this->request->setCard($card);
|
||||
$data = $this->request->getData();
|
||||
|
||||
$this->assertArrayNotHasKey('email', $data['billing_details']);
|
||||
}
|
||||
}
|
||||
59
vendor/omnipay/stripe/tests/Message/PaymentIntents/DetachPaymentMethodRequestTest.php
vendored
Normal file
59
vendor/omnipay/stripe/tests/Message/PaymentIntents/DetachPaymentMethodRequestTest.php
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace Omnipay\Stripe\Message\PaymentIntents;
|
||||
|
||||
use Omnipay\Tests\TestCase;
|
||||
|
||||
class DetachPaymentMethodRequestTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->request = new DetachPaymentMethodRequest($this->getHttpClient(), $this->getHttpRequest());
|
||||
$this->request->setPaymentMethod('pm_some_visa');
|
||||
}
|
||||
|
||||
public function testEndpoint()
|
||||
{
|
||||
$this->assertSame('https://api.stripe.com/v1/payment_methods/pm_some_visa/detach', $this->request->getEndpoint());
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Omnipay\Common\Exception\InvalidRequestException
|
||||
* @expectedExceptionMessage The paymentMethod parameter is required
|
||||
*/
|
||||
public function testMissingPaymentMethod()
|
||||
{
|
||||
$this->request->setPaymentMethod(null);
|
||||
$this->request->getData();
|
||||
}
|
||||
|
||||
public function testData()
|
||||
{
|
||||
$this->assertEmpty($this->request->getData());
|
||||
}
|
||||
|
||||
public function testSendSuccess()
|
||||
{
|
||||
$this->setMockHttpResponse('DetachPaymentMethodSuccess.txt');
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertTrue($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertNull($response->getTransactionReference());
|
||||
$this->assertSame('cus_3f2EpMK2kPm90g', $response->getCustomerReference());
|
||||
$this->assertSame('pm_1EUon32Tb35ankTnF6nuoRVE', $response->getCardReference());
|
||||
$this->assertNull($response->getMessage());
|
||||
}
|
||||
|
||||
public function testSendFailure()
|
||||
{
|
||||
$this->setMockHttpResponse('DetachPaymentMethodFailure.txt');
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertNull($response->getTransactionReference());
|
||||
$this->assertNull($response->getCardReference());
|
||||
$this->assertSame('The payment method you provided is not attached to a customer so detachment is impossible.', $response->getMessage());
|
||||
}
|
||||
}
|
||||
63
vendor/omnipay/stripe/tests/Message/PaymentIntents/FetchPaymentIntentRequestTest.php
vendored
Normal file
63
vendor/omnipay/stripe/tests/Message/PaymentIntents/FetchPaymentIntentRequestTest.php
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace Omnipay\Stripe\Message\PaymentIntents;
|
||||
|
||||
use Omnipay\Tests\TestCase;
|
||||
|
||||
class FetchPaymentIntentRequestTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->request = new FetchPaymentIntentRequest($this->getHttpClient(), $this->getHttpRequest());
|
||||
$this->request->setPaymentIntentReference('pi_valid_intent');
|
||||
}
|
||||
|
||||
public function testEndpoint()
|
||||
{
|
||||
$this->assertSame('https://api.stripe.com/v1/payment_intents/pi_valid_intent', $this->request->getEndpoint());
|
||||
}
|
||||
|
||||
public function testHttpMethod()
|
||||
{
|
||||
$this->assertSame('GET', $this->request->getHttpMethod());
|
||||
}
|
||||
|
||||
/**
|
||||
* Manually fetching an intent would most likely occur after 3DS authentication
|
||||
*/
|
||||
public function test3dsSuccess()
|
||||
{
|
||||
$this->setMockHttpResponse('FetchIntentReadyToConfirm.txt');
|
||||
$response = $this->request->send();
|
||||
$this->assertTrue($response->requiresConfirmation());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertNull($response->getTransactionReference());
|
||||
$this->assertSame('requires_confirmation', $response->getStatus());
|
||||
$this->assertSame('pi_1Ev1ezFSbr6xR4YAtM76y2kZ', $response->getPaymentIntentReference());
|
||||
}
|
||||
|
||||
/**
|
||||
* Most common case would be failed 3DS authentication.
|
||||
*/
|
||||
public function testPaymentMethodRequired()
|
||||
{
|
||||
$this->setMockHttpResponse('FetchIntentPaymentMethodRequired.txt');
|
||||
$response = $this->request->send();
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertNull($response->getCustomerReference());
|
||||
$this->assertSame('requires_payment_method', $response->getStatus());
|
||||
$this->assertSame('pi_1Ev1ZFFSbr6xR4YAlcdtdqGH', $response->getPaymentIntentReference());
|
||||
}
|
||||
|
||||
public function testSendFailure()
|
||||
{
|
||||
$this->setMockHttpResponse('FetchIntentFailure.txt');
|
||||
$response = $this->request->send();
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertNull($response->getTransactionReference());
|
||||
$this->assertNull($response->getCustomerReference());
|
||||
$this->assertSame('No such payment_intent: pi_1EUon12Tb35ankTnZyvC3sSdE', $response->getMessage());
|
||||
}
|
||||
}
|
||||
43
vendor/omnipay/stripe/tests/Message/PaymentIntents/FetchPaymentMethodRequestTest.php
vendored
Normal file
43
vendor/omnipay/stripe/tests/Message/PaymentIntents/FetchPaymentMethodRequestTest.php
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Omnipay\Stripe\Message\PaymentIntents;
|
||||
|
||||
use Omnipay\Tests\TestCase;
|
||||
|
||||
class FetchPaymentMethodRequestTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->request = new FetchPaymentMethodRequest($this->getHttpClient(), $this->getHttpRequest());
|
||||
$this->request->setPaymentMethod('pm_valid_method');
|
||||
}
|
||||
|
||||
public function testEndpoint()
|
||||
{
|
||||
$this->assertSame('https://api.stripe.com/v1/payment_methods/pm_valid_method', $this->request->getEndpoint());
|
||||
}
|
||||
|
||||
public function testHttpMethod()
|
||||
{
|
||||
$this->assertSame('GET', $this->request->getHttpMethod());
|
||||
}
|
||||
|
||||
public function testSendSuccess()
|
||||
{
|
||||
$this->setMockHttpResponse('FetchPaymentMethodSuccess.txt');
|
||||
$response = $this->request->send();
|
||||
$this->assertTrue($response->isSuccessful());
|
||||
$this->assertSame('pm_1F55vt2okp6n5dXo2WxJfirJ', $response->getCardReference());
|
||||
$this->assertSame('cus_FaCqpKDSJvFSsC', $response->getCustomerReference());
|
||||
}
|
||||
|
||||
public function testSendFailure()
|
||||
{
|
||||
$this->setMockHttpResponse('FetchPaymentMethodFailure.txt');
|
||||
$response = $this->request->send();
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertNull($response->getCardReference());
|
||||
$this->assertNull($response->getCustomerReference());
|
||||
$this->assertSame('No such payment_method: pm_1F52R22okp6n5dKoGSAKgKUX', $response->getMessage());
|
||||
}
|
||||
}
|
||||
16
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/AttachPaymentMethodFailure.txt
vendored
Normal file
16
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/AttachPaymentMethodFailure.txt
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
HTTP/1.1 402 Payment Required
|
||||
Server: nginx
|
||||
Date: Tue, 26 Feb 2013 16:17:02 GMT
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 139
|
||||
Connection: keep-alive
|
||||
Access-Control-Max-Age: 300
|
||||
Access-Control-Allow-Credentials: true
|
||||
Cache-Control: no-cache, no-store
|
||||
|
||||
{
|
||||
"error": {
|
||||
"message": "This PaymentMethod was previously used without being attached to a Customer or was detached from a Customer, and may not be used again.",
|
||||
"type": "invalid_request_error"
|
||||
}
|
||||
}
|
||||
50
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/AttachPaymentMethodSuccess.txt
vendored
Normal file
50
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/AttachPaymentMethodSuccess.txt
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
HTTP/1.1 200 OK
|
||||
Server: nginx
|
||||
Date: Tue, 26 Feb 2013 16:11:12 GMT
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Connection: keep-alive
|
||||
Access-Control-Max-Age: 300
|
||||
Access-Control-Allow-Credentials: true
|
||||
Cache-Control: no-cache, no-store
|
||||
|
||||
{
|
||||
"id": "pm_1EUon32Tb35ankTnF6nuoRVE",
|
||||
"object": "payment_method",
|
||||
"billing_details": {
|
||||
"address": {
|
||||
"city": null,
|
||||
"country": null,
|
||||
"line1": null,
|
||||
"line2": null,
|
||||
"postal_code": null,
|
||||
"state": null
|
||||
},
|
||||
"email": null,
|
||||
"name": null,
|
||||
"phone": null
|
||||
},
|
||||
"card": {
|
||||
"brand": "visa",
|
||||
"checks": {
|
||||
"address_line1_check": null,
|
||||
"address_postal_code_check": null,
|
||||
"cvc_check": null
|
||||
},
|
||||
"country": "US",
|
||||
"exp_month": 8,
|
||||
"exp_year": 2020,
|
||||
"fingerprint": "9OyiQNfcCMaD1b7P",
|
||||
"funding": "credit",
|
||||
"generated_from": null,
|
||||
"last4": "4242",
|
||||
"three_d_secure_usage": {
|
||||
"supported": true
|
||||
},
|
||||
"wallet": null
|
||||
},
|
||||
"created": 1556603165,
|
||||
"customer": "cus_3f2EpMK2kPm90g",
|
||||
"livemode": false,
|
||||
"metadata": {},
|
||||
"type": "card"
|
||||
}
|
||||
24
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/AuthorizeFailure.txt
vendored
Normal file
24
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/AuthorizeFailure.txt
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
HTTP/1.1 400 Bad Request
|
||||
server: nginx
|
||||
date: Thu, 11 Jul 2019 08:46:44 GMT
|
||||
content-type: application/json
|
||||
content-length: 247
|
||||
access-control-allow-credentials: true
|
||||
access-control-allow-methods: GET, POST, HEAD, OPTIONS, DELETE
|
||||
access-control-allow-origin: *
|
||||
access-control-expose-headers: Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
|
||||
access-control-max-age: 300
|
||||
cache-control: no-cache, no-store
|
||||
request-id: req_IznB7F29VYnxZj
|
||||
stripe-version: 2019-03-14
|
||||
strict-transport-security: max-age=31556926; includeSubDomains; preload
|
||||
|
||||
{
|
||||
"error": {
|
||||
"code": "resource_missing",
|
||||
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
|
||||
"message": "No such payment_method: pm_invalid_method",
|
||||
"param": "payment_method",
|
||||
"type": "invalid_request_error"
|
||||
}
|
||||
}
|
||||
60
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/AuthorizeSuccess.txt
vendored
Normal file
60
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/AuthorizeSuccess.txt
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
HTTP/1.1 200 OK
|
||||
Server: nginx
|
||||
Date: Fri, 15 Feb 2013 18:25:28 GMT
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 995
|
||||
Connection: keep-alive
|
||||
Cache-Control: no-cache, no-store
|
||||
Request-Id: req_8PDHeZazN2LwML
|
||||
Access-Control-Allow-Credentials: true
|
||||
Access-Control-Max-Age: 300
|
||||
|
||||
{
|
||||
"id": "pi_1Euf5UFSbr6xR4YAp9PPTxza",
|
||||
"object": "payment_intent",
|
||||
"amount": 8000,
|
||||
"amount_capturable": 0,
|
||||
"amount_received": 0,
|
||||
"application": null,
|
||||
"application_fee_amount": null,
|
||||
"canceled_at": null,
|
||||
"cancellation_reason": null,
|
||||
"capture_method": "manual",
|
||||
"charges": {
|
||||
"object": "list",
|
||||
"data": [],
|
||||
"has_more": false,
|
||||
"total_count": 0,
|
||||
"url": "\/v1\/charges?payment_intent=pi_1Euf5UFSbr6xR4YAp9PPTxza"
|
||||
},
|
||||
"client_secret": "pi_1Euf5UFSbr6xR4YAp9PPTxza_secret_QjDdAp77yVbiJoyJ92mXx76F7",
|
||||
"confirmation_method": "manual",
|
||||
"created": 1562762396,
|
||||
"currency": "usd",
|
||||
"customer": "cus_F1UMEEnT2OBgMg",
|
||||
"description": "Order #153",
|
||||
"invoice": null,
|
||||
"last_payment_error": null,
|
||||
"livemode": false,
|
||||
"metadata": {
|
||||
"order_id": "153",
|
||||
"order_number": "d1defe5bbef31c3472b06d3c8c723baf",
|
||||
"transaction_reference": "386b931a5e2bdb0a216749d488367b94",
|
||||
"client_ip": "::1"
|
||||
},
|
||||
"next_action": null,
|
||||
"on_behalf_of": null,
|
||||
"payment_method": "pm_1Euf5RFSbr6xR4YAwZ5fP28B",
|
||||
"payment_method_types": [
|
||||
"card"
|
||||
],
|
||||
"receipt_email": null,
|
||||
"review": null,
|
||||
"setup_future_usage": null,
|
||||
"shipping": null,
|
||||
"source": null,
|
||||
"statement_descriptor": null,
|
||||
"status": "requires_confirmation",
|
||||
"transfer_data": null,
|
||||
"transfer_group": null
|
||||
}
|
||||
80
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/CancelPaymentIntentFailure.txt
vendored
Normal file
80
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/CancelPaymentIntentFailure.txt
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
HTTP/1.1 400 Bad Request
|
||||
server: nginx
|
||||
date: Wed, 07 Aug 2019 01:29:44 GMT
|
||||
content-type: application/json
|
||||
content-length: 2005
|
||||
access-control-allow-credentials: true
|
||||
access-control-allow-methods: GET, POST, HEAD, OPTIONS, DELETE
|
||||
access-control-allow-origin: *
|
||||
access-control-expose-headers: Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
|
||||
access-control-max-age: 300
|
||||
cache-control: no-cache, no-store
|
||||
request-id: req_W9rdDlUahgd6iC
|
||||
stripe-version: 2018-05-21
|
||||
strict-transport-security: max-age=31556926; includeSubDomains; preload
|
||||
|
||||
{
|
||||
"error": {
|
||||
"code": "payment_intent_unexpected_state",
|
||||
"doc_url": "https://stripe.com/docs/error-codes/payment-intent-unexpected-state",
|
||||
"message": "You cannot cancel this PaymentIntent because it has a status of canceled. Only a PaymentIntent with one of the following statuses may be canceled: requires_payment_method, requires_capture, requires_confirmation, requires_action.",
|
||||
"payment_intent": {
|
||||
"id": "pi_1Evf5q2okp6n5dKoviPU2IkK",
|
||||
"object": "payment_intent",
|
||||
"allowed_source_types": [
|
||||
"card"
|
||||
],
|
||||
"amount": 1099,
|
||||
"amount_capturable": 0,
|
||||
"amount_received": 0,
|
||||
"application": null,
|
||||
"application_fee_amount": null,
|
||||
"canceled_at": 1565141374,
|
||||
"cancellation_reason": null,
|
||||
"capture_method": "automatic",
|
||||
"charges": {
|
||||
"object": "list",
|
||||
"data": [
|
||||
|
||||
],
|
||||
"has_more": false,
|
||||
"total_count": 0,
|
||||
"url": "/v1/charges?payment_intent=pi_1Evf5q2okp6n5dKoviPU2IkK"
|
||||
},
|
||||
"client_secret": "pi_1Evf5q2okp6n5dKoviPU2IkK_secret_uXzcxJ2um6t790XAokzr2HsTN",
|
||||
"confirmation_method": "automatic",
|
||||
"created": 1563000746,
|
||||
"currency": "aud",
|
||||
"customer": null,
|
||||
"description": null,
|
||||
"invoice": null,
|
||||
"last_payment_error": null,
|
||||
"livemode": false,
|
||||
"metadata": {
|
||||
},
|
||||
"next_action": null,
|
||||
"next_source_action": null,
|
||||
"on_behalf_of": null,
|
||||
"payment_method": null,
|
||||
"payment_method_options": {
|
||||
"card": {
|
||||
"request_three_d_secure": "automatic"
|
||||
}
|
||||
},
|
||||
"payment_method_types": [
|
||||
"card"
|
||||
],
|
||||
"receipt_email": null,
|
||||
"review": null,
|
||||
"setup_future_usage": "off_session",
|
||||
"shipping": null,
|
||||
"source": null,
|
||||
"statement_descriptor": null,
|
||||
"statement_descriptor_suffix": null,
|
||||
"status": "canceled",
|
||||
"transfer_data": null,
|
||||
"transfer_group": null
|
||||
},
|
||||
"type": "invalid_request_error"
|
||||
}
|
||||
}
|
||||
182
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/CancelPaymentIntentSuccess.txt
vendored
Normal file
182
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/CancelPaymentIntentSuccess.txt
vendored
Normal file
@@ -0,0 +1,182 @@
|
||||
HTTP/1.1 200 OK
|
||||
server: nginx
|
||||
date: Wed, 07 Aug 2019 04:08:43 GMT
|
||||
content-type: application/json
|
||||
content-length: 4790
|
||||
access-control-allow-credentials: true
|
||||
access-control-allow-methods: GET, POST, HEAD, OPTIONS, DELETE
|
||||
access-control-allow-origin: *
|
||||
access-control-expose-headers: Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
|
||||
access-control-max-age: 300
|
||||
cache-control: no-cache, no-store
|
||||
request-id: req_pDQDQOBBz7ipht
|
||||
stripe-version: 2018-05-21
|
||||
strict-transport-security: max-age=31556926; includeSubDomains; preload
|
||||
|
||||
{
|
||||
"id": "pi_1F4Oq22okp6n5dKoErGka6we",
|
||||
"object": "payment_intent",
|
||||
"allowed_source_types": [
|
||||
"card"
|
||||
],
|
||||
"amount": 52510,
|
||||
"amount_capturable": 0,
|
||||
"amount_received": 0,
|
||||
"application": null,
|
||||
"application_fee_amount": null,
|
||||
"canceled_at": 1565150923,
|
||||
"cancellation_reason": null,
|
||||
"capture_method": "manual",
|
||||
"charges": {
|
||||
"object": "list",
|
||||
"data": [
|
||||
{
|
||||
"id": "ch_1F4OqH2okp6n5dKoWlN61H9w",
|
||||
"object": "charge",
|
||||
"amount": 52510,
|
||||
"amount_refunded": 52510,
|
||||
"application": null,
|
||||
"application_fee": null,
|
||||
"application_fee_amount": null,
|
||||
"balance_transaction": null,
|
||||
"billing_details": {
|
||||
"address": {
|
||||
"city": "New York",
|
||||
"country": "US",
|
||||
"line1": "325 Broadway",
|
||||
"line2": null,
|
||||
"postal_code": "10007",
|
||||
"state": "New York"
|
||||
},
|
||||
"email": null,
|
||||
"name": "Jack Beanstalk",
|
||||
"phone": null
|
||||
},
|
||||
"captured": false,
|
||||
"created": 1565083229,
|
||||
"currency": "usd",
|
||||
"customer": "cus_FZXvpeIdgVYdmq",
|
||||
"description": null,
|
||||
"destination": null,
|
||||
"dispute": null,
|
||||
"failure_code": null,
|
||||
"failure_message": null,
|
||||
"fraud_details": {
|
||||
},
|
||||
"invoice": null,
|
||||
"livemode": false,
|
||||
"metadata": {
|
||||
},
|
||||
"on_behalf_of": null,
|
||||
"order": null,
|
||||
"outcome": {
|
||||
"network_status": "approved_by_network",
|
||||
"reason": null,
|
||||
"risk_level": "normal",
|
||||
"risk_score": 1,
|
||||
"seller_message": "Payment complete.",
|
||||
"type": "authorized"
|
||||
},
|
||||
"paid": true,
|
||||
"payment_intent": "pi_1F4Oq22okp6n5dKoErGka6we",
|
||||
"payment_method": "pm_1F4Oq02okp6n5dKoKfHmMyJN",
|
||||
"payment_method_details": {
|
||||
"card": {
|
||||
"brand": "visa",
|
||||
"checks": {
|
||||
"address_line1_check": "pass",
|
||||
"address_postal_code_check": "pass",
|
||||
"cvc_check": "pass"
|
||||
},
|
||||
"country": null,
|
||||
"exp_month": 2,
|
||||
"exp_year": 2022,
|
||||
"fingerprint": "TfHYiz2pR4RQdLsw",
|
||||
"funding": "credit",
|
||||
"last4": "3220",
|
||||
"three_d_secure": {
|
||||
"authenticated": true,
|
||||
"succeeded": true,
|
||||
"version": "2.1.0"
|
||||
},
|
||||
"wallet": null
|
||||
},
|
||||
"type": "card"
|
||||
},
|
||||
"receipt_email": null,
|
||||
"receipt_number": null,
|
||||
"receipt_url": "redacted",
|
||||
"refunded": true,
|
||||
"refunds": {
|
||||
"object": "list",
|
||||
"data": [
|
||||
{
|
||||
"id": "re_1F4gS62okp6n5dKoWNSLVaLS",
|
||||
"object": "refund",
|
||||
"amount": 52510,
|
||||
"balance_transaction": null,
|
||||
"charge": "ch_1F4OqH2okp6n5dKoWlN61H9w",
|
||||
"created": 1565150922,
|
||||
"currency": "usd",
|
||||
"metadata": {
|
||||
},
|
||||
"reason": null,
|
||||
"receipt_number": null,
|
||||
"source_transfer_reversal": null,
|
||||
"status": "succeeded",
|
||||
"transfer_reversal": null
|
||||
}
|
||||
],
|
||||
"has_more": false,
|
||||
"total_count": 1,
|
||||
"url": "/v1/charges/ch_1F4OqH2okp7n5dKoWlN61H9w/refunds"
|
||||
},
|
||||
"review": null,
|
||||
"shipping": null,
|
||||
"source": null,
|
||||
"source_transfer": null,
|
||||
"statement_descriptor": null,
|
||||
"statement_descriptor_suffix": null,
|
||||
"status": "succeeded",
|
||||
"transfer_data": null,
|
||||
"transfer_group": null
|
||||
}
|
||||
],
|
||||
"has_more": false,
|
||||
"total_count": 1,
|
||||
"url": "/v1/charges?payment_intent=pi_1F4Oq22okp6n5dKoErGka6we"
|
||||
},
|
||||
"client_secret": "pi_1F4Oq22okp6n5dKoErGka68e_secret_rUBo6oC0Tvx1V12QBZMimJrCS",
|
||||
"confirmation_method": "manual",
|
||||
"created": 1565083214,
|
||||
"currency": "usd",
|
||||
"customer": "cus_FZXvpeIdgVYdmq",
|
||||
"description": null,
|
||||
"invoice": null,
|
||||
"last_payment_error": null,
|
||||
"livemode": false,
|
||||
"metadata": {
|
||||
},
|
||||
"next_action": null,
|
||||
"next_source_action": null,
|
||||
"on_behalf_of": null,
|
||||
"payment_method": "pm_1F4Oq02okp6n5dKoKfHmMyJN",
|
||||
"payment_method_options": {
|
||||
"card": {
|
||||
"request_three_d_secure": "automatic"
|
||||
}
|
||||
},
|
||||
"payment_method_types": [
|
||||
"card"
|
||||
],
|
||||
"receipt_email": null,
|
||||
"review": null,
|
||||
"setup_future_usage": "on_session",
|
||||
"shipping": null,
|
||||
"source": null,
|
||||
"statement_descriptor": null,
|
||||
"statement_descriptor_suffix": null,
|
||||
"status": "canceled",
|
||||
"transfer_data": null,
|
||||
"transfer_group": null
|
||||
}
|
||||
23
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/CaptureFailure.txt
vendored
Normal file
23
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/CaptureFailure.txt
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
HTTP/1.1 400 Bad Request
|
||||
server: nginx
|
||||
date: Thu, 11 Jul 2019 08:46:44 GMT
|
||||
content-type: application/json
|
||||
content-length: 247
|
||||
access-control-allow-credentials: true
|
||||
access-control-allow-methods: GET, POST, HEAD, OPTIONS, DELETE
|
||||
access-control-allow-origin: *
|
||||
access-control-expose-headers: Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
|
||||
access-control-max-age: 300
|
||||
cache-control: no-cache, no-store
|
||||
request-id: req_IznB7F29VYnxZj
|
||||
stripe-version: 2019-03-14
|
||||
strict-transport-security: max-age=31556926; includeSubDomains; preload
|
||||
|
||||
{
|
||||
"error": {
|
||||
"code": "payment_intent_unexpected_state",
|
||||
"doc_url": "https://stripe.com/docs/error-codes/payment-intent-unexpected-state",
|
||||
"message": "This PaymentIntent could not be captured because it has already been captured.",
|
||||
"type": "invalid_request_error"
|
||||
}
|
||||
}
|
||||
170
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/CaptureSuccess.txt
vendored
Normal file
170
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/CaptureSuccess.txt
vendored
Normal file
@@ -0,0 +1,170 @@
|
||||
HTTP/1.1 200 OK
|
||||
Server: nginx
|
||||
Date: Fri, 15 Feb 2013 18:25:28 GMT
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 995
|
||||
Connection: keep-alive
|
||||
Cache-Control: no-cache, no-store
|
||||
Request-Id: req_8PDHeZazN2LwML
|
||||
Access-Control-Allow-Credentials: true
|
||||
Access-Control-Max-Age: 300
|
||||
|
||||
{
|
||||
"id": "pi_1EUon22Tb35ankTnMW9GNjSh",
|
||||
"object": "payment_intent",
|
||||
"amount": 8000,
|
||||
"amount_capturable": 0,
|
||||
"amount_received": 8000,
|
||||
"application": null,
|
||||
"application_fee_amount": null,
|
||||
"canceled_at": null,
|
||||
"cancellation_reason": null,
|
||||
"capture_method": "manual",
|
||||
"charges": {
|
||||
"object": "list",
|
||||
"data": [
|
||||
{
|
||||
"id": "ch_1EZvfwFSbr6xR4YAWulsIcYV",
|
||||
"object": "charge",
|
||||
"amount": 8000,
|
||||
"amount_refunded": 2000,
|
||||
"application": null,
|
||||
"application_fee": null,
|
||||
"application_fee_amount": null,
|
||||
"balance_transaction": "txn_1EZvjKFSbr6xR4YAvqraMGP8",
|
||||
"billing_details": {
|
||||
"address": {
|
||||
"city": "New York",
|
||||
"country": "United States"
|
||||
},
|
||||
"email": "some@person.com",
|
||||
"name": "Jeff Bridge",
|
||||
"phone": null
|
||||
},
|
||||
"captured": true,
|
||||
"created": 1557821272,
|
||||
"currency": "usd",
|
||||
"customer": "cus_F1UMEEnT2OBgMg",
|
||||
"description": "Order #69",
|
||||
"destination": null,
|
||||
"dispute": null,
|
||||
"failure_code": null,
|
||||
"failure_message": null,
|
||||
"fraud_details": {},
|
||||
"invoice": null,
|
||||
"livemode": false,
|
||||
"metadata": {
|
||||
"order_id": "69",
|
||||
"order_number": "47eae2af9d6f75b51e7111e27a43617b",
|
||||
"transaction_reference": "8e914cb212f2e4c2a83e280d8b99488a",
|
||||
"client_ip": "::1"
|
||||
},
|
||||
"on_behalf_of": null,
|
||||
"order": null,
|
||||
"outcome": {
|
||||
"network_status": "approved_by_network",
|
||||
"reason": null,
|
||||
"risk_level": "normal",
|
||||
"risk_score": 38,
|
||||
"rule": "allow_if_3ds_authenticated_liability_shift",
|
||||
"seller_message": "Payment complete.",
|
||||
"type": "authorized"
|
||||
},
|
||||
"paid": true,
|
||||
"payment_intent": "pi_1EUon22Tb35ankTnMW9GNjSh",
|
||||
"payment_method": "pm_1EZvfYFSbr6xR4YAGMpD5hNj",
|
||||
"payment_method_details": {
|
||||
"card": {
|
||||
"brand": "visa",
|
||||
"checks": {
|
||||
"address_line1_check": "pass",
|
||||
"address_postal_code_check": "pass",
|
||||
"cvc_check": "pass"
|
||||
},
|
||||
"country": "IE",
|
||||
"exp_month": 12,
|
||||
"exp_year": 2020,
|
||||
"fingerprint": "TLkivWVGoP3a2M2U",
|
||||
"funding": "credit",
|
||||
"last4": "3220",
|
||||
"three_d_secure": {
|
||||
"authenticated": true,
|
||||
"succeeded": true,
|
||||
"version": "2.1.0"
|
||||
},
|
||||
"wallet": null
|
||||
},
|
||||
"type": "card"
|
||||
},
|
||||
"receipt_email": null,
|
||||
"receipt_number": null,
|
||||
"receipt_url": "https://pay.stripe.com/receipts/acct_1AjnbxFSbr6xR4YA/ch_1EZvfwFSbr6xR4YAWulsIcYV/rcpt_F43njL6DofvVuE7tlNDARemskoCJxff",
|
||||
"refunded": false,
|
||||
"refunds": {
|
||||
"object": "list",
|
||||
"data": [
|
||||
{
|
||||
"id": "re_1EZvjaFSbr6xR4YAbdaX3k3R",
|
||||
"object": "refund",
|
||||
"amount": 2000,
|
||||
"balance_transaction": "txn_1EZvjaFSbr6xR4YAtzwsSxhk",
|
||||
"charge": "ch_1EZvfwFSbr6xR4YAWulsIcYV",
|
||||
"created": 1557821498,
|
||||
"currency": "usd",
|
||||
"metadata": {},
|
||||
"reason": null,
|
||||
"receipt_number": null,
|
||||
"source_transfer_reversal": null,
|
||||
"status": "succeeded",
|
||||
"transfer_reversal": null
|
||||
}
|
||||
],
|
||||
"has_more": false,
|
||||
"total_count": 1,
|
||||
"url": "/v1/charges/ch_1EZvfwFSbr6xR4YAWulsIcYV/refunds"
|
||||
},
|
||||
"review": null,
|
||||
"shipping": null,
|
||||
"source": null,
|
||||
"source_transfer": null,
|
||||
"statement_descriptor": null,
|
||||
"status": "succeeded",
|
||||
"transfer_data": null,
|
||||
"transfer_group": null
|
||||
}
|
||||
],
|
||||
"has_more": false,
|
||||
"total_count": 1,
|
||||
"url": "/v1/charges?payment_intent=pi_1EUon22Tb35ankTnMW9GNjSh"
|
||||
},
|
||||
"client_secret": "pi_1EUon22Tb35ankTnMW9GNjSh_secret_kxK3CBky2Uex0ctbsFxbokHyu",
|
||||
"confirmation_method": "manual",
|
||||
"created": 1557821043,
|
||||
"currency": "usd",
|
||||
"customer": "cus_F1UMEEnT2OBgMg",
|
||||
"description": "Order #69",
|
||||
"invoice": null,
|
||||
"last_payment_error": null,
|
||||
"livemode": false,
|
||||
"metadata": {
|
||||
"order_id": "69",
|
||||
"order_number": "47eae2af9d6f75b51e7111e27a43617b",
|
||||
"transaction_reference": "8e914cb212f2e4c2a83e280d8b99488a",
|
||||
"client_ip": "::1"
|
||||
},
|
||||
"next_action": null,
|
||||
"on_behalf_of": null,
|
||||
"payment_method": "pm_1EZvfYFSbr6xR4YAGMpD5hNj",
|
||||
"payment_method_types": [
|
||||
"card"
|
||||
],
|
||||
"receipt_email": null,
|
||||
"review": null,
|
||||
"setup_future_usage": null,
|
||||
"shipping": null,
|
||||
"source": null,
|
||||
"statement_descriptor": null,
|
||||
"status": "succeeded",
|
||||
"transfer_data": null,
|
||||
"transfer_group": null
|
||||
}
|
||||
65
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/ConfirmIntent3dsRedirect.txt
vendored
Normal file
65
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/ConfirmIntent3dsRedirect.txt
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
HTTP/1.1 200 OK
|
||||
Server: nginx
|
||||
Date: Sun, 05 May 2013 08:51:15 GMT
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 997
|
||||
Connection: keep-alive
|
||||
Cache-Control: no-cache, no-store
|
||||
Access-Control-Max-Age: 300
|
||||
Access-Control-Allow-Credentials: true
|
||||
|
||||
{
|
||||
"id": "pi_1Ev1M1FSbr6xR4YAgJIBBVX0",
|
||||
"object": "payment_intent",
|
||||
"amount": 8000,
|
||||
"amount_capturable": 0,
|
||||
"amount_received": 0,
|
||||
"application": null,
|
||||
"application_fee_amount": null,
|
||||
"canceled_at": null,
|
||||
"cancellation_reason": null,
|
||||
"capture_method": "manual",
|
||||
"charges": {
|
||||
"object": "list",
|
||||
"data": [],
|
||||
"has_more": false,
|
||||
"total_count": 0,
|
||||
"url": "\/v1\/charges?payment_intent=pi_1Ev1M1FSbr6xR4YAgJIBBVX0"
|
||||
},
|
||||
"client_secret": "pi_1Ev1M1FSbr6xR4YAgJIBBVX0_secret_MfGgtbEAM6GZ4JyquqbC09FXC",
|
||||
"confirmation_method": "manual",
|
||||
"created": 1562847989,
|
||||
"currency": "usd",
|
||||
"customer": "cus_Q8sHn93nAzgdn1",
|
||||
"description": "Order #184",
|
||||
"invoice": null,
|
||||
"last_payment_error": null,
|
||||
"livemode": false,
|
||||
"metadata": {
|
||||
"order_id": "184",
|
||||
"order_number": "fd17b4d8d756814bc6a258ba578fc359",
|
||||
"transaction_reference": "939185d93ad0634402cbe45b833e7428",
|
||||
"client_ip": "::1"
|
||||
},
|
||||
"next_action": {
|
||||
"redirect_to_url": {
|
||||
"return_url": "http:\/\/this-is-a-test-site.test\/complete-payment?foo=bar",
|
||||
"url": "https:\/\/hooks.stripe.com\/3d_secure_2_eap\/begin_test\/src_1Ev1M5FSbr6xR4YAg5qdBN6B\/src_client_secret_FPr4a6wAiVNi6YrnuI7vah6H"
|
||||
},
|
||||
"type": "redirect_to_url"
|
||||
},
|
||||
"on_behalf_of": null,
|
||||
"payment_method": "pm_1Ev1LzFSbr6xR4YA0TZ8jta0",
|
||||
"payment_method_types": [
|
||||
"card"
|
||||
],
|
||||
"receipt_email": null,
|
||||
"review": null,
|
||||
"setup_future_usage": null,
|
||||
"shipping": null,
|
||||
"source": null,
|
||||
"statement_descriptor": null,
|
||||
"status": "requires_action",
|
||||
"transfer_data": null,
|
||||
"transfer_group": null
|
||||
}
|
||||
65
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/ConfirmIntentMissingRedirect.txt
vendored
Normal file
65
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/ConfirmIntentMissingRedirect.txt
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
HTTP/1.1 200 OK
|
||||
Server: nginx
|
||||
Date: Sun, 05 May 2013 08:51:15 GMT
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 997
|
||||
Connection: keep-alive
|
||||
Cache-Control: no-cache, no-store
|
||||
Access-Control-Max-Age: 300
|
||||
Access-Control-Allow-Credentials: true
|
||||
|
||||
{
|
||||
"id": "pi_1Ev1CeFSbr6xR4YAbVhiBUv0",
|
||||
"object": "payment_intent",
|
||||
"amount": 8000,
|
||||
"amount_capturable": 0,
|
||||
"amount_received": 0,
|
||||
"application": null,
|
||||
"application_fee_amount": null,
|
||||
"canceled_at": null,
|
||||
"cancellation_reason": null,
|
||||
"capture_method": "manual",
|
||||
"charges": {
|
||||
"object": "list",
|
||||
"data": [],
|
||||
"has_more": false,
|
||||
"total_count": 0,
|
||||
"url": "\/v1\/charges?payment_intent=pi_1Ev1CeFSbr6xR4YAbVhiBUv0"
|
||||
},
|
||||
"client_secret": "pi_1Ev1CeFSbr6xR4YAbVhiBUv0_secret_E8pK2lfYBh00cUEPMuTUrrqqR",
|
||||
"confirmation_method": "manual",
|
||||
"created": 1562847408,
|
||||
"currency": "usd",
|
||||
"customer": null,
|
||||
"description": "Order #184",
|
||||
"invoice": null,
|
||||
"last_payment_error": null,
|
||||
"livemode": false,
|
||||
"metadata": {
|
||||
"order_id": "184",
|
||||
"order_number": "fd17b4d8d756814bc6a258ba578fc359",
|
||||
"transaction_reference": "9d60ca0be3cc29276ddd5462be1d07a3",
|
||||
"client_ip": "::1"
|
||||
},
|
||||
"next_action": {
|
||||
"type": "use_stripe_sdk",
|
||||
"use_stripe_sdk": {
|
||||
"type": "three_d_secure_redirect",
|
||||
"stripe_js": "https:\/\/hooks.stripe.com\/3d_secure_2_eap\/begin_test\/src_1Ev1CiFSbr6xR4YAAz2cQKVv\/src_client_secret_FPquGxLPzcJz5ToIUwtRRsO3"
|
||||
}
|
||||
},
|
||||
"on_behalf_of": null,
|
||||
"payment_method": "pm_1Ev1CcFSbr6xR4YAuKuJgwEs",
|
||||
"payment_method_types": [
|
||||
"card"
|
||||
],
|
||||
"receipt_email": null,
|
||||
"review": null,
|
||||
"setup_future_usage": null,
|
||||
"shipping": null,
|
||||
"source": null,
|
||||
"statement_descriptor": null,
|
||||
"status": "requires_action",
|
||||
"transfer_data": null,
|
||||
"transfer_group": null
|
||||
}
|
||||
150
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/ConfirmIntentSuccess.txt
vendored
Normal file
150
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/ConfirmIntentSuccess.txt
vendored
Normal file
@@ -0,0 +1,150 @@
|
||||
HTTP/1.1 200 OK
|
||||
Server: nginx
|
||||
Date: Sun, 05 May 2013 08:51:15 GMT
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 997
|
||||
Connection: keep-alive
|
||||
Cache-Control: no-cache, no-store
|
||||
Access-Control-Max-Age: 300
|
||||
Access-Control-Allow-Credentials: true
|
||||
|
||||
{
|
||||
"id": "pi_1Ev0a2FSbr6xR4YAsGQmFF0X",
|
||||
"object": "payment_intent",
|
||||
"amount": 8000,
|
||||
"amount_capturable": 8000,
|
||||
"amount_received": 0,
|
||||
"application": null,
|
||||
"application_fee_amount": null,
|
||||
"canceled_at": null,
|
||||
"cancellation_reason": null,
|
||||
"capture_method": "manual",
|
||||
"charges": {
|
||||
"object": "list",
|
||||
"data": [{
|
||||
"id": "ch_1Ev0a3FSbr6xR4YApjrlyFGi",
|
||||
"object": "charge",
|
||||
"amount": 8000,
|
||||
"amount_refunded": 0,
|
||||
"application": null,
|
||||
"application_fee": null,
|
||||
"application_fee_amount": null,
|
||||
"balance_transaction": null,
|
||||
"billing_details": {
|
||||
"address": {
|
||||
"city": null,
|
||||
"country": null,
|
||||
"line1": null,
|
||||
"line2": null,
|
||||
"postal_code": null,
|
||||
"state": null
|
||||
},
|
||||
"email": "somebody@somewhere.net",
|
||||
"name": "Jack Beanstalk",
|
||||
"phone": null
|
||||
},
|
||||
"captured": false,
|
||||
"created": 1562845015,
|
||||
"currency": "usd",
|
||||
"customer": null,
|
||||
"description": "Order #182",
|
||||
"destination": null,
|
||||
"dispute": null,
|
||||
"failure_code": null,
|
||||
"failure_message": null,
|
||||
"fraud_details": [],
|
||||
"invoice": null,
|
||||
"livemode": false,
|
||||
"metadata": {
|
||||
"order_id": "182",
|
||||
"order_number": "936dd9e6904c4bb2a8f65837d1d6403c",
|
||||
"transaction_reference": "09f0cd14d0594e76ca53b78e98f80414",
|
||||
"client_ip": "::1"
|
||||
},
|
||||
"on_behalf_of": null,
|
||||
"order": null,
|
||||
"outcome": {
|
||||
"network_status": "approved_by_network",
|
||||
"reason": null,
|
||||
"risk_level": "normal",
|
||||
"risk_score": 17,
|
||||
"seller_message": "Payment complete.",
|
||||
"type": "authorized"
|
||||
},
|
||||
"paid": true,
|
||||
"payment_intent": "pi_1Ev0a2FSbr6xR4YAsGQmFF0X",
|
||||
"payment_method": "pm_1Ev0ZyFSbr6xR4YAX3vLBqEC",
|
||||
"payment_method_details": {
|
||||
"card": {
|
||||
"brand": "amex",
|
||||
"checks": {
|
||||
"address_line1_check": null,
|
||||
"address_postal_code_check": null,
|
||||
"cvc_check": "pass"
|
||||
},
|
||||
"country": "US",
|
||||
"exp_month": 12,
|
||||
"exp_year": 2020,
|
||||
"fingerprint": "fHKFepx6M3kreij5",
|
||||
"funding": "credit",
|
||||
"last4": "0005",
|
||||
"three_d_secure": null,
|
||||
"wallet": null
|
||||
},
|
||||
"type": "card"
|
||||
},
|
||||
"receipt_email": null,
|
||||
"receipt_number": null,
|
||||
"receipt_url": "https:\/\/pay.stripe.com\/receipts\/acct_1AjnbxFSbr6xR4YA\/ch_1Ev0a3FSbr6xR4YApjrlyFGi\/rcpt_FPqGKvHPhVfeinM9z4h2lTp3LleIV3c",
|
||||
"refunded": false,
|
||||
"refunds": {
|
||||
"object": "list",
|
||||
"data": [],
|
||||
"has_more": false,
|
||||
"total_count": 0,
|
||||
"url": "\/v1\/charges\/ch_1Ev0a3FSbr6xR4YApjrlyFGi\/refunds"
|
||||
},
|
||||
"review": null,
|
||||
"shipping": null,
|
||||
"source": null,
|
||||
"source_transfer": null,
|
||||
"statement_descriptor": null,
|
||||
"status": "succeeded",
|
||||
"transfer_data": null,
|
||||
"transfer_group": null
|
||||
}],
|
||||
"has_more": false,
|
||||
"total_count": 1,
|
||||
"url": "\/v1\/charges?payment_intent=pi_1Ev0a2FSbr6xR4YAsGQmFF0X"
|
||||
},
|
||||
"client_secret": "pi_1Ev0a2FSbr6xR4YAsGQmFF0X_secret_CWVHEZ8cOk21GTABOjWHBYLt0",
|
||||
"confirmation_method": "manual",
|
||||
"created": 1562845014,
|
||||
"currency": "usd",
|
||||
"customer": null,
|
||||
"description": "Order #182",
|
||||
"invoice": null,
|
||||
"last_payment_error": null,
|
||||
"livemode": false,
|
||||
"metadata": {
|
||||
"order_id": "182",
|
||||
"order_number": "936dd9e6904c4bb2a8f65837d1d6403c",
|
||||
"transaction_reference": "09f0cd14d0594e76ca53b78e98f80414",
|
||||
"client_ip": "::1"
|
||||
},
|
||||
"next_action": null,
|
||||
"on_behalf_of": null,
|
||||
"payment_method": "pm_1Ev0ZyFSbr6xR4YAX3vLBqEC",
|
||||
"payment_method_types": [
|
||||
"card"
|
||||
],
|
||||
"receipt_email": null,
|
||||
"review": null,
|
||||
"setup_future_usage": null,
|
||||
"shipping": null,
|
||||
"source": null,
|
||||
"statement_descriptor": null,
|
||||
"status": "requires_capture",
|
||||
"transfer_data": null,
|
||||
"transfer_group": null
|
||||
}
|
||||
19
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/CreatePaymentMethodFailure.txt
vendored
Normal file
19
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/CreatePaymentMethodFailure.txt
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
HTTP/1.1 402 Payment Required
|
||||
Server: nginx
|
||||
Date: Tue, 26 Feb 2013 16:17:02 GMT
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 139
|
||||
Connection: keep-alive
|
||||
Access-Control-Max-Age: 300
|
||||
Access-Control-Allow-Credentials: true
|
||||
Cache-Control: no-cache, no-store
|
||||
|
||||
{
|
||||
"error": {
|
||||
"code": "parameter_invalid_integer",
|
||||
"doc_url": "https://stripe.com/docs/error-codes/parameter-invalid-integer",
|
||||
"message": "Invalid integer: xyz",
|
||||
"param": "card[exp_year]",
|
||||
"type": "invalid_request_error"
|
||||
}
|
||||
}
|
||||
50
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/CreatePaymentMethodSuccess.txt
vendored
Normal file
50
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/CreatePaymentMethodSuccess.txt
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
HTTP/1.1 200 OK
|
||||
Server: nginx
|
||||
Date: Tue, 26 Feb 2013 16:11:12 GMT
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Connection: keep-alive
|
||||
Access-Control-Max-Age: 300
|
||||
Access-Control-Allow-Credentials: true
|
||||
Cache-Control: no-cache, no-store
|
||||
|
||||
{
|
||||
"id": "pm_1EUon32Tb35ankTnF6nuoRVE",
|
||||
"object": "payment_method",
|
||||
"billing_details": {
|
||||
"address": {
|
||||
"city": null,
|
||||
"country": null,
|
||||
"line1": null,
|
||||
"line2": null,
|
||||
"postal_code": null,
|
||||
"state": null
|
||||
},
|
||||
"email": null,
|
||||
"name": null,
|
||||
"phone": null
|
||||
},
|
||||
"card": {
|
||||
"brand": "visa",
|
||||
"checks": {
|
||||
"address_line1_check": null,
|
||||
"address_postal_code_check": null,
|
||||
"cvc_check": null
|
||||
},
|
||||
"country": "US",
|
||||
"exp_month": 8,
|
||||
"exp_year": 2020,
|
||||
"fingerprint": "9OyiQNfcCMaD1b7P",
|
||||
"funding": "credit",
|
||||
"generated_from": null,
|
||||
"last4": "4242",
|
||||
"three_d_secure_usage": {
|
||||
"supported": true
|
||||
},
|
||||
"wallet": null
|
||||
},
|
||||
"created": 1556603165,
|
||||
"customer": null,
|
||||
"livemode": false,
|
||||
"metadata": {},
|
||||
"type": "card"
|
||||
}
|
||||
16
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/DetachPaymentMethodFailure.txt
vendored
Normal file
16
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/DetachPaymentMethodFailure.txt
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
HTTP/1.1 402 Payment Required
|
||||
Server: nginx
|
||||
Date: Tue, 26 Feb 2013 16:17:02 GMT
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 139
|
||||
Connection: keep-alive
|
||||
Access-Control-Max-Age: 300
|
||||
Access-Control-Allow-Credentials: true
|
||||
Cache-Control: no-cache, no-store
|
||||
|
||||
{
|
||||
"error": {
|
||||
"message": "The payment method you provided is not attached to a customer so detachment is impossible.",
|
||||
"type": "invalid_request_error"
|
||||
}
|
||||
}
|
||||
50
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/DetachPaymentMethodSuccess.txt
vendored
Normal file
50
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/DetachPaymentMethodSuccess.txt
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
HTTP/1.1 200 OK
|
||||
Server: nginx
|
||||
Date: Tue, 26 Feb 2013 16:11:12 GMT
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Connection: keep-alive
|
||||
Access-Control-Max-Age: 300
|
||||
Access-Control-Allow-Credentials: true
|
||||
Cache-Control: no-cache, no-store
|
||||
|
||||
{
|
||||
"id": "pm_1EUon32Tb35ankTnF6nuoRVE",
|
||||
"object": "payment_method",
|
||||
"billing_details": {
|
||||
"address": {
|
||||
"city": null,
|
||||
"country": null,
|
||||
"line1": null,
|
||||
"line2": null,
|
||||
"postal_code": null,
|
||||
"state": null
|
||||
},
|
||||
"email": null,
|
||||
"name": null,
|
||||
"phone": null
|
||||
},
|
||||
"card": {
|
||||
"brand": "visa",
|
||||
"checks": {
|
||||
"address_line1_check": null,
|
||||
"address_postal_code_check": null,
|
||||
"cvc_check": null
|
||||
},
|
||||
"country": "US",
|
||||
"exp_month": 8,
|
||||
"exp_year": 2020,
|
||||
"fingerprint": "9OyiQNfcCMaD1b7P",
|
||||
"funding": "credit",
|
||||
"generated_from": null,
|
||||
"last4": "4242",
|
||||
"three_d_secure_usage": {
|
||||
"supported": true
|
||||
},
|
||||
"wallet": null
|
||||
},
|
||||
"created": 1556603165,
|
||||
"customer": "cus_3f2EpMK2kPm90g",
|
||||
"livemode": false,
|
||||
"metadata": {},
|
||||
"type": "card"
|
||||
}
|
||||
24
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/FetchIntentFailure.txt
vendored
Normal file
24
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/FetchIntentFailure.txt
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
HTTP/1.1 400 Bad Request
|
||||
server: nginx
|
||||
date: Thu, 11 Jul 2019 08:46:44 GMT
|
||||
content-type: application/json
|
||||
content-length: 247
|
||||
access-control-allow-credentials: true
|
||||
access-control-allow-methods: GET, POST, HEAD, OPTIONS, DELETE
|
||||
access-control-allow-origin: *
|
||||
access-control-expose-headers: Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
|
||||
access-control-max-age: 300
|
||||
cache-control: no-cache, no-store
|
||||
request-id: req_IznB7F29VYnxZj
|
||||
stripe-version: 2019-03-14
|
||||
strict-transport-security: max-age=31556926; includeSubDomains; preload
|
||||
|
||||
{
|
||||
"error": {
|
||||
"code": "resource_missing",
|
||||
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
|
||||
"message": "No such payment_intent: pi_1EUon12Tb35ankTnZyvC3sSdE",
|
||||
"param": "intent",
|
||||
"type": "invalid_request_error"
|
||||
}
|
||||
}
|
||||
105
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/FetchIntentPaymentMethodRequired.txt
vendored
Normal file
105
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/FetchIntentPaymentMethodRequired.txt
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
HTTP/1.1 200 OK
|
||||
Server: nginx
|
||||
Date: Sun, 05 May 2013 08:51:15 GMT
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 997
|
||||
Connection: keep-alive
|
||||
Cache-Control: no-cache, no-store
|
||||
Access-Control-Max-Age: 300
|
||||
Access-Control-Allow-Credentials: true
|
||||
|
||||
{
|
||||
"id": "pi_1Ev1ZFFSbr6xR4YAlcdtdqGH",
|
||||
"object": "payment_intent",
|
||||
"amount": 8000,
|
||||
"amount_capturable": 0,
|
||||
"amount_received": 0,
|
||||
"application": null,
|
||||
"application_fee_amount": null,
|
||||
"canceled_at": null,
|
||||
"cancellation_reason": null,
|
||||
"capture_method": "manual",
|
||||
"charges": {
|
||||
"object": "list",
|
||||
"data": [],
|
||||
"has_more": false,
|
||||
"total_count": 0,
|
||||
"url": "\/v1\/charges?payment_intent=pi_1Ev1ZFFSbr6xR4YAlcdtdqGH"
|
||||
},
|
||||
"client_secret": "pi_1Ev1ZFFSbr6xR4YAlcdtdqGH_secret_dpqra3YEDAA6JTVQdyZj8us0Q",
|
||||
"confirmation_method": "manual",
|
||||
"created": 1562848809,
|
||||
"currency": "usd",
|
||||
"customer": null,
|
||||
"description": "Order #184",
|
||||
"invoice": null,
|
||||
"last_payment_error": {
|
||||
"code": "payment_intent_authentication_failure",
|
||||
"doc_url": "https:\/\/stripe.com\/docs\/error-codes\/payment-intent-authentication-failure",
|
||||
"message": "The provided PaymentMethod has failed authentication. You can provide payment_method_data or a new PaymentMethod to attempt to fulfill this PaymentIntent again.",
|
||||
"payment_method": {
|
||||
"id": "pm_1Ev1ZCFSbr6xR4YA2vAxx9L7",
|
||||
"object": "payment_method",
|
||||
"billing_details": {
|
||||
"address": {
|
||||
"city": null,
|
||||
"country": null,
|
||||
"line1": null,
|
||||
"line2": null,
|
||||
"postal_code": null,
|
||||
"state": null
|
||||
},
|
||||
"email": "some@email.com",
|
||||
"name": "Just Guy",
|
||||
"phone": null
|
||||
},
|
||||
"card": {
|
||||
"brand": "visa",
|
||||
"checks": {
|
||||
"address_line1_check": null,
|
||||
"address_postal_code_check": null,
|
||||
"cvc_check": "unchecked"
|
||||
},
|
||||
"country": "IE",
|
||||
"exp_month": 12,
|
||||
"exp_year": 2020,
|
||||
"fingerprint": "TLkivWVGoP3a2M2U",
|
||||
"funding": "credit",
|
||||
"generated_from": null,
|
||||
"last4": "3220",
|
||||
"three_d_secure_usage": {
|
||||
"supported": true
|
||||
},
|
||||
"wallet": null
|
||||
},
|
||||
"created": 1562848806,
|
||||
"customer": null,
|
||||
"livemode": false,
|
||||
"metadata": [],
|
||||
"type": "card"
|
||||
},
|
||||
"type": "invalid_request_error"
|
||||
},
|
||||
"livemode": false,
|
||||
"metadata": {
|
||||
"order_id": "184",
|
||||
"order_number": "fd17b4d8d756814bc6a258ba578fc359",
|
||||
"transaction_reference": "4a846a6e34639f22926e14e283ff8f90",
|
||||
"client_ip": "::1"
|
||||
},
|
||||
"next_action": null,
|
||||
"on_behalf_of": null,
|
||||
"payment_method": null,
|
||||
"payment_method_types": [
|
||||
"card"
|
||||
],
|
||||
"receipt_email": null,
|
||||
"review": null,
|
||||
"setup_future_usage": null,
|
||||
"shipping": null,
|
||||
"source": null,
|
||||
"statement_descriptor": null,
|
||||
"status": "requires_payment_method",
|
||||
"transfer_data": null,
|
||||
"transfer_group": null
|
||||
}
|
||||
59
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/FetchIntentReadyToConfirm.txt
vendored
Normal file
59
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/FetchIntentReadyToConfirm.txt
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
HTTP/1.1 200 OK
|
||||
Server: nginx
|
||||
Date: Sun, 05 May 2013 08:51:15 GMT
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 997
|
||||
Connection: keep-alive
|
||||
Cache-Control: no-cache, no-store
|
||||
Access-Control-Max-Age: 300
|
||||
Access-Control-Allow-Credentials: true
|
||||
|
||||
{
|
||||
"id": "pi_1Ev1ezFSbr6xR4YAtM76y2kZ",
|
||||
"object": "payment_intent",
|
||||
"amount": 8000,
|
||||
"amount_capturable": 0,
|
||||
"amount_received": 0,
|
||||
"application": null,
|
||||
"application_fee_amount": null,
|
||||
"canceled_at": null,
|
||||
"cancellation_reason": null,
|
||||
"capture_method": "manual",
|
||||
"charges": {
|
||||
"object": "list",
|
||||
"data": [],
|
||||
"has_more": false,
|
||||
"total_count": 0,
|
||||
"url": "\/v1\/charges?payment_intent=pi_1Ev1ezFSbr6xR4YAtM76y2kZ"
|
||||
},
|
||||
"client_secret": "pi_1Ev1ezFSbr6xR4YAtM76y2kZ_secret_1LNKABAbQzLv0PLghVQ9KzLtJ",
|
||||
"confirmation_method": "manual",
|
||||
"created": 1562849165,
|
||||
"currency": "usd",
|
||||
"customer": null,
|
||||
"description": "Order #184",
|
||||
"invoice": null,
|
||||
"last_payment_error": null,
|
||||
"livemode": false,
|
||||
"metadata": {
|
||||
"order_id": "184",
|
||||
"order_number": "fd17b4d8d756814bc6a258ba578fc359",
|
||||
"transaction_reference": "4bd4f322cf005e954c78194633b58b0b",
|
||||
"client_ip": "::1"
|
||||
},
|
||||
"next_action": null,
|
||||
"on_behalf_of": null,
|
||||
"payment_method": "pm_1Ev1ewFSbr6xR4YAM7H9IPu8",
|
||||
"payment_method_types": [
|
||||
"card"
|
||||
],
|
||||
"receipt_email": null,
|
||||
"review": null,
|
||||
"setup_future_usage": null,
|
||||
"shipping": null,
|
||||
"source": null,
|
||||
"statement_descriptor": null,
|
||||
"status": "requires_confirmation",
|
||||
"transfer_data": null,
|
||||
"transfer_group": null
|
||||
}
|
||||
24
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/FetchPaymentMethodFailure.txt
vendored
Normal file
24
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/FetchPaymentMethodFailure.txt
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
HTTP/1.1 404 Not Found
|
||||
server: nginx
|
||||
date: Fri, 09 Aug 2019 00:23:41 GMT
|
||||
content-type: application/json
|
||||
content-length: 261
|
||||
access-control-allow-credentials: true
|
||||
access-control-allow-methods: GET, POST, HEAD, OPTIONS, DELETE
|
||||
access-control-allow-origin: *
|
||||
access-control-expose-headers: Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
|
||||
access-control-max-age: 300
|
||||
cache-control: no-cache, no-store
|
||||
request-id: req_CCSqQgjNH68hv0
|
||||
stripe-version: 2018-05-21
|
||||
strict-transport-security: max-age=31556926; includeSubDomains; preload
|
||||
|
||||
{
|
||||
"error": {
|
||||
"code": "resource_missing",
|
||||
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
|
||||
"message": "No such payment_method: pm_1F52R22okp6n5dKoGSAKgKUX",
|
||||
"param": "payment_method",
|
||||
"type": "invalid_request_error"
|
||||
}
|
||||
}
|
||||
57
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/FetchPaymentMethodSuccess.txt
vendored
Normal file
57
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/FetchPaymentMethodSuccess.txt
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
HTTP/1.1 200 OK
|
||||
server: nginx
|
||||
date: Fri, 09 Aug 2019 00:14:56 GMT
|
||||
content-type: application/json
|
||||
content-length: 906
|
||||
access-control-allow-credentials: true
|
||||
access-control-allow-methods: GET, POST, HEAD, OPTIONS, DELETE
|
||||
access-control-allow-origin: *
|
||||
access-control-expose-headers: Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
|
||||
access-control-max-age: 300
|
||||
cache-control: no-cache, no-store
|
||||
request-id: req_uy4QJE6oEIHUFv
|
||||
stripe-version: 2018-05-21
|
||||
strict-transport-security: max-age=31556926; includeSubDomains; preload
|
||||
|
||||
{
|
||||
"id": "pm_1F55vt2okp6n5dXo2WxJfirJ",
|
||||
"object": "payment_method",
|
||||
"billing_details": {
|
||||
"address": {
|
||||
"city": "New Alessia",
|
||||
"country": "AU",
|
||||
"line1": "679 Berge Course",
|
||||
"line2": null,
|
||||
"postal_code": "50762-1465",
|
||||
"state": "Alabama"
|
||||
},
|
||||
"email": "user@stripe.com",
|
||||
"name": "Jack Beanstalk",
|
||||
"phone": null
|
||||
},
|
||||
"card": {
|
||||
"brand": "visa",
|
||||
"checks": {
|
||||
"address_line1_check": "pass",
|
||||
"address_postal_code_check": "pass",
|
||||
"cvc_check": "pass"
|
||||
},
|
||||
"country": "AU",
|
||||
"exp_month": 2,
|
||||
"exp_year": 2022,
|
||||
"fingerprint": "bTL1Ce0N4U41rp8s",
|
||||
"funding": "credit",
|
||||
"generated_from": null,
|
||||
"last4": "0006",
|
||||
"three_d_secure_usage": {
|
||||
"supported": true
|
||||
},
|
||||
"wallet": null
|
||||
},
|
||||
"created": 1565248870,
|
||||
"customer": "cus_FaCqpKDSJvFSsC",
|
||||
"livemode": false,
|
||||
"metadata": {
|
||||
},
|
||||
"type": "card"
|
||||
}
|
||||
155
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/PurchaseSuccess.txt
vendored
Normal file
155
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/PurchaseSuccess.txt
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
HTTP/1.1 200 OK
|
||||
Server: nginx
|
||||
Date: Fri, 15 Feb 2013 18:25:28 GMT
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 995
|
||||
Connection: keep-alive
|
||||
Cache-Control: no-cache, no-store
|
||||
Request-Id: req_8PDHeZazN2LwML
|
||||
Access-Control-Allow-Credentials: true
|
||||
Access-Control-Max-Age: 300
|
||||
|
||||
{
|
||||
"id": "pi_1EW0FmFSbr6xR4YAvECSRCv2",
|
||||
"object": "payment_intent",
|
||||
"amount": 8000,
|
||||
"amount_capturable": 0,
|
||||
"amount_received": 8000,
|
||||
"application": null,
|
||||
"application_fee_amount": null,
|
||||
"canceled_at": null,
|
||||
"cancellation_reason": null,
|
||||
"capture_method": "automatic",
|
||||
"charges": {
|
||||
"object": "list",
|
||||
"data": [
|
||||
{
|
||||
"id": "ch_1EW0FmFSbr6xR4YAZyURWxQe",
|
||||
"object": "charge",
|
||||
"amount": 8000,
|
||||
"amount_refunded": 0,
|
||||
"application": null,
|
||||
"application_fee": null,
|
||||
"application_fee_amount": null,
|
||||
"balance_transaction": "txn_1EW0FnFSbr6xR4YAOVasO6Eu",
|
||||
"billing_details": {
|
||||
"address": {
|
||||
"city": "Riga",
|
||||
"country": "United States",
|
||||
"line1": "GARRISON DRIVE 60837",
|
||||
"line2": null,
|
||||
"postal_code": "97702",
|
||||
"state": null
|
||||
},
|
||||
"email": "andris@shift.lv",
|
||||
"name": "Janice Friend",
|
||||
"phone": null
|
||||
},
|
||||
"captured": true,
|
||||
"created": 1556885558,
|
||||
"currency": "usd",
|
||||
"customer": "cus_F0026biLhRIcO9",
|
||||
"description": "Order #34",
|
||||
"destination": null,
|
||||
"dispute": null,
|
||||
"failure_code": null,
|
||||
"failure_message": null,
|
||||
"fraud_details": {
|
||||
},
|
||||
"invoice": null,
|
||||
"livemode": false,
|
||||
"metadata": {
|
||||
"order_id": "34",
|
||||
"order_number": "aaefd8ec96095c47ed0c665666c3c768",
|
||||
"transaction_reference": "84aaac664c7048000146d3a88b5f0081",
|
||||
"client_ip": "::1"
|
||||
},
|
||||
"on_behalf_of": null,
|
||||
"order": null,
|
||||
"outcome": {
|
||||
"network_status": "approved_by_network",
|
||||
"reason": null,
|
||||
"risk_level": "normal",
|
||||
"risk_score": 21,
|
||||
"seller_message": "Payment complete.",
|
||||
"type": "authorized"
|
||||
},
|
||||
"paid": true,
|
||||
"payment_intent": "pi_1EW0FmFSbr6xR4YAvECSRCv2",
|
||||
"payment_method": "pm_1EW0FPFSbr6xR4YAZOSMHIOE",
|
||||
"payment_method_details": {
|
||||
"card": {
|
||||
"brand": "visa",
|
||||
"checks": {
|
||||
"address_line1_check": "pass",
|
||||
"address_postal_code_check": "pass",
|
||||
"cvc_check": "pass"
|
||||
},
|
||||
"country": "US",
|
||||
"description": "Visa Classic",
|
||||
"exp_month": 12,
|
||||
"exp_year": 2020,
|
||||
"fingerprint": "ZpBtWK0wNH3oi8mw",
|
||||
"funding": "credit",
|
||||
"last4": "4242",
|
||||
"three_d_secure": null,
|
||||
"wallet": null
|
||||
},
|
||||
"type": "card"
|
||||
},
|
||||
"receipt_email": null,
|
||||
"receipt_number": null,
|
||||
"receipt_url": "https://pay.stripe.com/receipts/acct_1AjnbxFSbr6xR4YA/ch_1EW0FmFSbr6xR4YAZyURWxQe/rcpt_F00G6tmZch7lV8HQbMulDt61Fd2T3Co",
|
||||
"refunded": false,
|
||||
"refunds": {
|
||||
"object": "list",
|
||||
"data": [
|
||||
],
|
||||
"has_more": false,
|
||||
"total_count": 0,
|
||||
"url": "/v1/charges/ch_1EW0FmFSbr6xR4YAZyURWxQe/refunds"
|
||||
},
|
||||
"review": null,
|
||||
"shipping": null,
|
||||
"source": null,
|
||||
"source_transfer": null,
|
||||
"statement_descriptor": null,
|
||||
"status": "succeeded",
|
||||
"transfer_data": null,
|
||||
"transfer_group": null
|
||||
}
|
||||
],
|
||||
"has_more": false,
|
||||
"total_count": 1,
|
||||
"url": "/v1/charges?payment_intent=pi_1EW0FmFSbr6xR4YAvECSRCv2"
|
||||
},
|
||||
"client_secret": "pi_1EW0FmFSbr6xR4YAvECSRCv2_secret_kUQ34vTWkFRAECbpbswOpAuus",
|
||||
"confirmation_method": "automatic",
|
||||
"created": 1556885558,
|
||||
"currency": "usd",
|
||||
"customer": "cus_F0026biLhRIcO9",
|
||||
"description": "Order #34",
|
||||
"invoice": null,
|
||||
"last_payment_error": null,
|
||||
"livemode": false,
|
||||
"metadata": {
|
||||
"order_id": "34",
|
||||
"order_number": "aaefd8ec96095c47ed0c665666c3c768",
|
||||
"transaction_reference": "84aaac664c7048000146d3a88b5f0081",
|
||||
"client_ip": "::1"
|
||||
},
|
||||
"next_action": null,
|
||||
"on_behalf_of": null,
|
||||
"payment_method": "pm_1EW0FPFSbr6xR4YAZOSMHIOE",
|
||||
"payment_method_types": [
|
||||
"card"
|
||||
],
|
||||
"receipt_email": null,
|
||||
"review": null,
|
||||
"shipping": null,
|
||||
"source": null,
|
||||
"statement_descriptor": null,
|
||||
"status": "succeeded",
|
||||
"transfer_data": null,
|
||||
"transfer_group": null
|
||||
}
|
||||
16
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/UpdatePaymentMethodFailure.txt
vendored
Normal file
16
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/UpdatePaymentMethodFailure.txt
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
HTTP/1.1 402 Payment Required
|
||||
Server: nginx
|
||||
Date: Tue, 26 Feb 2013 16:17:02 GMT
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 139
|
||||
Connection: keep-alive
|
||||
Access-Control-Max-Age: 300
|
||||
Access-Control-Allow-Credentials: true
|
||||
Cache-Control: no-cache, no-store
|
||||
|
||||
{
|
||||
"error": {
|
||||
"message": "You must save this PaymentMethod to a customer before you can update it.",
|
||||
"type": "invalid_request_error"
|
||||
}
|
||||
}
|
||||
53
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/UpdatePaymentMethodSuccess.txt
vendored
Normal file
53
vendor/omnipay/stripe/tests/Message/PaymentIntents/Mock/UpdatePaymentMethodSuccess.txt
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
HTTP/1.1 200 OK
|
||||
Server: nginx
|
||||
Date: Tue, 26 Feb 2013 16:17:02 GMT
|
||||
Content-Type: application/json;charset=utf-8
|
||||
Content-Length: 139
|
||||
Connection: keep-alive
|
||||
Access-Control-Max-Age: 300
|
||||
Access-Control-Allow-Credentials: true
|
||||
Cache-Control: no-cache, no-store
|
||||
|
||||
{
|
||||
"id": "pm_1EUon32Tb35ankTnF6nuoRVE",
|
||||
"object": "payment_method",
|
||||
"billing_details": {
|
||||
"address": {
|
||||
"city": null,
|
||||
"country": null,
|
||||
"line1": null,
|
||||
"line2": null,
|
||||
"postal_code": null,
|
||||
"state": null
|
||||
},
|
||||
"email": null,
|
||||
"name": null,
|
||||
"phone": null
|
||||
},
|
||||
"card": {
|
||||
"brand": "visa",
|
||||
"checks": {
|
||||
"address_line1_check": null,
|
||||
"address_postal_code_check": null,
|
||||
"cvc_check": null
|
||||
},
|
||||
"country": "US",
|
||||
"exp_month": 8,
|
||||
"exp_year": 2020,
|
||||
"fingerprint": "9OyiQNfcCMaD1b7P",
|
||||
"funding": "credit",
|
||||
"generated_from": null,
|
||||
"last4": "4242",
|
||||
"three_d_secure_usage": {
|
||||
"supported": true
|
||||
},
|
||||
"wallet": null
|
||||
},
|
||||
"created": 1556603165,
|
||||
"customer": "cus_3f2EpMK2kPm90g",
|
||||
"livemode": false,
|
||||
"metadata": {
|
||||
"order_id": "6735"
|
||||
},
|
||||
"type": "card"
|
||||
}
|
||||
60
vendor/omnipay/stripe/tests/Message/PaymentIntents/PurchaseRequestTest.php
vendored
Normal file
60
vendor/omnipay/stripe/tests/Message/PaymentIntents/PurchaseRequestTest.php
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace Omnipay\Stripe\Message\PaymentIntents;
|
||||
|
||||
use Omnipay\Tests\TestCase;
|
||||
|
||||
class PurchaseRequestTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var PurchaseRequest
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->request = new PurchaseRequest($this->getHttpClient(), $this->getHttpRequest());
|
||||
$this->request->initialize(
|
||||
array(
|
||||
'amount' => '12.00',
|
||||
'currency' => 'USD',
|
||||
'paymentMethod' => 'pm_valid_payment_method',
|
||||
'description' => 'Order #42',
|
||||
'metadata' => array(
|
||||
'foo' => 'bar',
|
||||
),
|
||||
'applicationFee' => '1.00'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetData()
|
||||
{
|
||||
$data = $this->request->getData();
|
||||
|
||||
$this->assertSame(1200, $data['amount']);
|
||||
$this->assertSame('usd', $data['currency']);
|
||||
$this->assertSame('Order #42', $data['description']);
|
||||
$this->assertSame('automatic', $data['capture_method']);
|
||||
$this->assertSame('manual', $data['confirmation_method']);
|
||||
$this->assertSame('pm_valid_payment_method', $data['payment_method']);
|
||||
$this->assertSame(array('foo' => 'bar'), $data['metadata']);
|
||||
$this->assertSame(100, $data['application_fee']);
|
||||
}
|
||||
|
||||
public function testSendSuccessAndRequireConfirmation()
|
||||
{
|
||||
$this->setMockHttpResponse('PurchaseSuccess.txt');
|
||||
/** @var PaymentIntentsResponse $response */
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertTrue($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertFalse($response->requiresConfirmation());
|
||||
$this->assertSame('automatic', $response->getCaptureMethod());
|
||||
$this->assertSame('pm_1EW0FPFSbr6xR4YAZOSMHIOE', $response->getCardReference());
|
||||
$this->assertSame('req_8PDHeZazN2LwML', $response->getRequestId());
|
||||
$this->assertSame('cus_F0026biLhRIcO9', $response->getCustomerReference());
|
||||
$this->assertNull($response->getMessage());
|
||||
}
|
||||
}
|
||||
108
vendor/omnipay/stripe/tests/Message/PaymentIntents/ResponseTest.php
vendored
Normal file
108
vendor/omnipay/stripe/tests/Message/PaymentIntents/ResponseTest.php
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
namespace Omnipay\Stripe\Message\PaymentIntents;
|
||||
|
||||
use Omnipay\Tests\TestCase;
|
||||
|
||||
class ResponseTest extends TestCase
|
||||
{
|
||||
public function testStatus()
|
||||
{
|
||||
$httpResponse = $this->getMockHttpResponse('AuthorizeSuccess.txt');
|
||||
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());
|
||||
|
||||
$this->assertSame('requires_confirmation', $response->getStatus());
|
||||
}
|
||||
|
||||
public function testRequiresConfirmation()
|
||||
{
|
||||
$httpResponse = $this->getMockHttpResponse('AuthorizeSuccess.txt');
|
||||
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());
|
||||
|
||||
$this->assertTrue($response->requiresConfirmation());
|
||||
}
|
||||
|
||||
public function testGetCardReference()
|
||||
{
|
||||
$httpResponse = $this->getMockHttpResponse('AuthorizeSuccess.txt');
|
||||
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());
|
||||
|
||||
$this->assertSame('pm_1Euf5RFSbr6xR4YAwZ5fP28B', $response->getCardReference());
|
||||
|
||||
$httpResponse = $this->getMockHttpResponse('CreatePaymentMethodSuccess.txt');
|
||||
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());
|
||||
|
||||
$this->assertSame('pm_1EUon32Tb35ankTnF6nuoRVE', $response->getCardReference());
|
||||
}
|
||||
|
||||
public function testGetCustomerReference()
|
||||
{
|
||||
$httpResponse = $this->getMockHttpResponse('AuthorizeSuccess.txt');
|
||||
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());
|
||||
|
||||
$this->assertSame('cus_F1UMEEnT2OBgMg', $response->getCustomerReference());
|
||||
|
||||
$httpResponse = $this->getMockHttpResponse('ConfirmIntent3dsRedirect.txt');
|
||||
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());
|
||||
|
||||
$this->assertSame('cus_Q8sHn93nAzgdn1', $response->getCustomerReference());
|
||||
}
|
||||
|
||||
public function testGetCaptureMethod()
|
||||
{
|
||||
$httpResponse = $this->getMockHttpResponse('AuthorizeSuccess.txt');
|
||||
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());
|
||||
|
||||
$this->assertSame('manual', $response->getCaptureMethod());
|
||||
|
||||
$httpResponse = $this->getMockHttpResponse('PurchaseSuccess.txt');
|
||||
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());
|
||||
|
||||
$this->assertSame('automatic', $response->getCaptureMethod());
|
||||
}
|
||||
|
||||
public function testGetTransactionReference()
|
||||
{
|
||||
$httpResponse = $this->getMockHttpResponse('AuthorizeSuccess.txt');
|
||||
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());
|
||||
|
||||
$this->assertNull($response->getTransactionReference());
|
||||
|
||||
$httpResponse = $this->getMockHttpResponse('PurchaseSuccess.txt');
|
||||
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());
|
||||
|
||||
$this->assertSame('ch_1EW0FmFSbr6xR4YAZyURWxQe', $response->getTransactionReference());
|
||||
}
|
||||
|
||||
public function testRedirectsAndSuccess()
|
||||
{
|
||||
$httpResponse = $this->getMockHttpResponse('ConfirmIntent3dsRedirect.txt');
|
||||
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());
|
||||
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertTrue($response->isRedirect());
|
||||
$this->assertSame('https://hooks.stripe.com/3d_secure_2_eap/begin_test/src_1Ev1M5FSbr6xR4YAg5qdBN6B/src_client_secret_FPr4a6wAiVNi6YrnuI7vah6H', $response->getRedirectUrl());
|
||||
|
||||
$httpResponse = $this->getMockHttpResponse('AuthorizeFailure.txt');
|
||||
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());
|
||||
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertNull($response->getRedirectUrl());
|
||||
}
|
||||
|
||||
public function testCancelled()
|
||||
{
|
||||
$httpResponse = $this->getMockHttpResponse('CancelPaymentIntentSuccess.txt');
|
||||
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());
|
||||
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertTrue($response->isCancelled());
|
||||
|
||||
$httpResponse = $this->getMockHttpResponse('ConfirmIntentSuccess.txt');
|
||||
$response = new Response($this->getMockRequest(), (string) $httpResponse->getBody());
|
||||
|
||||
$this->assertTrue($response->isSuccessful());
|
||||
$this->assertFalse($response->isCancelled());
|
||||
}
|
||||
}
|
||||
62
vendor/omnipay/stripe/tests/Message/PaymentIntents/UpdatePaymentMethodRequestTest.php
vendored
Normal file
62
vendor/omnipay/stripe/tests/Message/PaymentIntents/UpdatePaymentMethodRequestTest.php
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace Omnipay\Stripe\Message\PaymentIntents;
|
||||
|
||||
use Omnipay\Tests\TestCase;
|
||||
|
||||
class UpdatePaymentMethodRequestTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
$this->request = new UpdatePaymentMethodRequest($this->getHttpClient(), $this->getHttpRequest());
|
||||
$this->request->setPaymentMethod('pm_some_visa');
|
||||
}
|
||||
|
||||
public function testEndpoint()
|
||||
{
|
||||
$this->assertSame('https://api.stripe.com/v1/payment_methods/pm_some_visa', $this->request->getEndpoint());
|
||||
}
|
||||
|
||||
public function testDataWithCard()
|
||||
{
|
||||
$card = $this->getValidCard();
|
||||
$metaData = [
|
||||
'meta' => 'data',
|
||||
'other' => 'metaData'
|
||||
];
|
||||
|
||||
$this->request->setCard($card);
|
||||
$this->request->setMetadata($metaData);
|
||||
$data = $this->request->getData();
|
||||
|
||||
$this->assertSame($card['billingAddress1'], $data['billing_details']['address']['line1']);
|
||||
$this->assertSame($card['firstName'] . ' ' . $card['lastName'], $data['billing_details']['name']);
|
||||
$this->assertSame($card['expiryYear'], $data['card']['exp_year']);
|
||||
$this->assertSame($metaData, $data['metadata']);
|
||||
$this->assertArrayNotHasKey('number', $data['card']);
|
||||
}
|
||||
|
||||
public function testSendSuccess()
|
||||
{
|
||||
$this->setMockHttpResponse('UpdatePaymentMethodSuccess.txt');
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertTrue($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertNull($response->getTransactionReference());
|
||||
$this->assertSame('pm_1EUon32Tb35ankTnF6nuoRVE', $response->getCardReference());
|
||||
$this->assertNull($response->getMessage());
|
||||
}
|
||||
|
||||
public function testSendFailure()
|
||||
{
|
||||
$this->setMockHttpResponse('UpdatePaymentMethodFailure.txt');
|
||||
$response = $this->request->send();
|
||||
|
||||
$this->assertFalse($response->isSuccessful());
|
||||
$this->assertFalse($response->isRedirect());
|
||||
$this->assertNull($response->getTransactionReference());
|
||||
$this->assertNull($response->getCardReference());
|
||||
$this->assertSame('You must save this PaymentMethod to a customer before you can update it.', $response->getMessage());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user