diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index 4a0d69e5d98e..7fdedfed9197 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -119,7 +119,7 @@ class StripePaymentDriver extends BaseDriver $types[] = GatewayType::BANK_TRANSFER; } - if ($this->company_gateway->getAchEnabled() + if ($this->company_gateway->getAlipayEnabled() && $this->client && isset($this->client->country) && in_array($this->client->country->iso_3166_3, ['AUS', 'DNK', 'DEU', 'ITA', 'LUX', 'NOR', 'SVN', 'GBR', 'AUT', 'EST', 'GRC', 'JPN', 'MYS', 'PRT', 'ESP', 'USA', 'BEL', 'FIN', 'HKG', 'LVA', 'NLD', 'SGP', 'SWE', 'CAN', 'FRA', 'IRL', 'LTU', 'NZL', 'SVK', 'CHE'])) { diff --git a/cypress.json b/cypress.json index f57c9ce64c18..4e694ea4f01e 100644 --- a/cypress.json +++ b/cypress.json @@ -1,8 +1,8 @@ { "video": false, - "baseUrl": "https://localhost:8000/", + "baseUrl": "http://localhost:8080/", "chromeWebSecurity": false, "env": { - "runningEnvironment": "native" + "runningEnvironment": "docker" } } diff --git a/cypress/integration/client_portal/stripe_ach.spec.js b/cypress/integration/client_portal/stripe_ach.spec.js new file mode 100644 index 000000000000..b4bfd02f39c8 --- /dev/null +++ b/cypress/integration/client_portal/stripe_ach.spec.js @@ -0,0 +1,68 @@ +describe('Stripe: ACH testing', () => { + before(() => { + // cy.artisan('migrate:fresh --seed'); + // cy.artisan('ninja:create-single-account checkout'); + }); + + beforeEach(() => { + cy.viewport('macbook-13'); + cy.clientLogin(); + }); + + afterEach(() => { + cy.visit('/client/logout'); + }); + + it('should be able to add bank account & verify it', function () { + cy.visit('/client/payment_methods'); + + cy.get('[data-cy=add-payment-method]').click(); + cy.get('[data-cy=add-bank-account-link]').click(); + + cy.get('#account-holder-name').type('Invoice Ninja Rocks'); + cy.get('#country').select('US'); + cy.get('#currency').select('USD'); + cy.get('#routing-number').type('110000000'); + cy.get('#account-number').type('000123456789'); + cy.get('#accept-terms').check(); + + cy.get('#save-button').click(); + + cy.url().should('contain', 'method=2'); + + cy.get('[data-cy=verification-1st]').type('32'); + cy.get('[data-cy=verification-2nd]').type('45'); + + cy.get('#pay-now').click(); + + cy.get('body').contains('Verification completed successfully'); + }); + + it('should be able to pay the invoice', function () { + cy.visit('/client/invoices'); + + cy.get('[data-cy=pay-now]').first().click(); + cy.get('[data-cy=pay-now-dropdown]').click(); + cy.get('[data-cy=pay-with-1]').click(); + + cy.get('[name=payment-type]').first().check(); + + cy.get('#pay-now').click(); + + cy.url().should('contain', '/client/payments/'); + }); + + it('should be able to remove payment method', function () { + cy.visit('/client/payment_methods'); + + cy.get('[data-cy=view-payment-method]').click(); + + cy.get('#open-delete-popup').click(); + + cy.get('[data-cy=confirm-payment-removal]').click(); + + cy.url().should('contain', '/client/payment_methods'); + + cy.get('body').contains('Payment method has been successfully removed.'); + }); +}); diff --git a/cypress/integration/client_portal/stripe_alipay.spec.js b/cypress/integration/client_portal/stripe_alipay.spec.js new file mode 100644 index 000000000000..73665167a36e --- /dev/null +++ b/cypress/integration/client_portal/stripe_alipay.spec.js @@ -0,0 +1,29 @@ +describe('Stripe: Alipay testing', () => { + before(() => { + // cy.artisan('migrate:fresh --seed'); + // cy.artisan('ninja:create-single-account checkout'); + }); + + beforeEach(() => { + cy.viewport('macbook-13'); + cy.clientLogin(); + }); + + afterEach(() => { + cy.visit('/client/logout'); + }); + + it('should be able to pay using Alipay', function () { + cy.visit('/client/invoices'); + + cy.get('[data-cy=pay-now]').first().click(); + cy.get('[data-cy=pay-now-dropdown]').click(); + cy.get('[data-cy=pay-with-1]').click(); + + cy.get('#pay-now').click(); + + cy.get('.common-ButtonGroup > .common-Button--default').click(); + + cy.url().should('contain', '/client/payments/'); + }); +}); diff --git a/cypress/integration/client_portal/stripe_sofort.spec.js b/cypress/integration/client_portal/stripe_sofort.spec.js new file mode 100644 index 000000000000..3a04ac8fc8a8 --- /dev/null +++ b/cypress/integration/client_portal/stripe_sofort.spec.js @@ -0,0 +1,29 @@ +describe('Stripe: SOFORT testing', () => { + before(() => { + // cy.artisan('migrate:fresh --seed'); + // cy.artisan('ninja:create-single-account checkout'); + }); + + beforeEach(() => { + cy.viewport('macbook-13'); + cy.clientLogin(); + }); + + afterEach(() => { + cy.visit('/client/logout'); + }); + + it('should be able to pay using SOFORT', function () { + cy.visit('/client/invoices'); + + cy.get('[data-cy=pay-now]').first().click(); + cy.get('[data-cy=pay-now-dropdown]').click(); + cy.get('[data-cy=pay-with-2]').click(); + + cy.get('#pay-now').click(); + + cy.get('.common-ButtonGroup > .common-Button--default').click(); + + cy.url().should('contain', '/client/payments/'); + }); +}); diff --git a/resources/views/portal/ninja2020/gateways/stripe/ach/verify.blade.php b/resources/views/portal/ninja2020/gateways/stripe/ach/verify.blade.php index 380b98584fc7..9cdcf2803c4e 100644 --- a/resources/views/portal/ninja2020/gateways/stripe/ach/verify.blade.php +++ b/resources/views/portal/ninja2020/gateways/stripe/ach/verify.blade.php @@ -11,15 +11,15 @@ @component('portal.ninja2020.components.general.card-element', ['title' => '#1 ' . ctrans('texts.amount')]) - + @endcomponent @component('portal.ninja2020.components.general.card-element', ['title' => '#2 ' . ctrans('texts.amount')]) - + @endcomponent - + @component('portal.ninja2020.gateways.includes.pay_now', ['type' => 'submit']) {{ ctrans('texts.complete_verification')}} @endcomponent -@endsection \ No newline at end of file +@endsection