-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Maintenance] Add sylius/paypal-plugin
- Loading branch information
Showing
13 changed files
with
156 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
services: | ||
Psr\Http\Message\RequestFactoryInterface: '@http_discovery.psr17_factory' | ||
Psr\Http\Message\ResponseFactoryInterface: '@http_discovery.psr17_factory' | ||
Psr\Http\Message\ServerRequestFactoryInterface: '@http_discovery.psr17_factory' | ||
Psr\Http\Message\StreamFactoryInterface: '@http_discovery.psr17_factory' | ||
Psr\Http\Message\UploadedFileFactoryInterface: '@http_discovery.psr17_factory' | ||
Psr\Http\Message\UriFactoryInterface: '@http_discovery.psr17_factory' | ||
|
||
http_discovery.psr17_factory: | ||
class: Http\Discovery\Psr17Factory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
sylius_paypal_webhook: | ||
resource: "@SyliusPayPalPlugin/Resources/config/webhook_routing.yaml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
sylius_admin: | ||
resource: "@SyliusAdminBundle/Resources/config/routing.yml" | ||
prefix: '/%sylius_admin.path_name%' | ||
|
||
sylius_paypal_admin: | ||
resource: "@SyliusPayPalPlugin/Resources/config/admin_routing.yml" | ||
prefix: '/%sylius_admin.path_name%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
templates/bundles/SyliusAdminBundle/PaymentMethod/Gateways/paymentGateways.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% for name, gateway in gatewayFactories %} | ||
<a href="{{ url('sylius_admin_payment_method_create', { 'factory': name }) }}" id="{{ name }}" class="item" {% if name == 'sylius.pay_pal' %}data-confirm-pay-pal-consent{% endif %}> | ||
{{ gateway|trans }} | ||
</a> | ||
{% endfor %} |
18 changes: 18 additions & 0 deletions
18
templates/bundles/SyliusShopBundle/Checkout/SelectPayment/_choice.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<div class="item" {{ sylius_test_html_attribute('payment-item') }}> | ||
<div class="field"> | ||
<div class="ui radio checkbox" {{ sylius_test_html_attribute('payment-method-checkbox') }}> | ||
{{ form_widget(form, sylius_test_form_attribute('payment-method-select')) }} | ||
</div> | ||
</div> | ||
<div class="content"> | ||
<a class="header">{{ form_label(form, null, {'label_attr': {'data-test-payment-method-label': ''}}) }}</a> | ||
{% if method.description is not null %} | ||
<div class="description"> | ||
<p>{{ method.description }}</p> | ||
</div> | ||
{% endif %} | ||
{% if order.checkoutState != constant('Sylius\\Component\\Core\\OrderCheckoutStates::STATE_COMPLETED') and method.gatewayConfig.factoryName == 'sylius.pay_pal' %} | ||
{{ render(controller('Sylius\\PayPalPlugin\\Controller\\PayPalButtonsController::renderPaymentPageButtonsAction', {'orderId': order.id})) }} | ||
{% endif %} | ||
</div> | ||
</div> |
23 changes: 23 additions & 0 deletions
23
templates/bundles/SyliusShopBundle/Common/Order/_addresses.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<div class="ui segment"> | ||
<div class="ui {% if order.isShippingRequired() %}two{% else %}one{% endif %} column divided stackable grid"> | ||
<div class="column" id="sylius-billing-address" {{ sylius_test_html_attribute('billing-address') }}> | ||
<div class="ui small dividing header">{{ 'sylius.ui.billing_address'|trans }}</div> | ||
{% include '@SyliusShop/Common/_address.html.twig' with {'address': order.billingAddress} %} | ||
</div> | ||
{% if order.isShippingRequired() %} | ||
<div class="column" id="sylius-shipping-address" {{ sylius_test_html_attribute('shipping-address') }}> | ||
<div class="ui small dividing header">{{ 'sylius.ui.shipping_address'|trans }}</div> | ||
{% include '@SyliusShop/Common/_address.html.twig' with {'address': order.shippingAddress} %} | ||
</div> | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% if sylius_is_billing_address_missing(order) %} | ||
<div class="ui icon message"> | ||
<i class="address card icon"></i> | ||
<div class="content"> | ||
<div class="header">{{ 'sylius.pay_pal.missing_billing_address_header'|trans }}</div> | ||
<p>{{ 'sylius.pay_pal.missing_billing_address_content'|trans }}</p> | ||
</div> | ||
</div> | ||
{% endif %} |
29 changes: 29 additions & 0 deletions
29
templates/bundles/SyliusShopBundle/Common/Order/_payments.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{% import "@SyliusShop/Common/Macro/money.html.twig" as money %} | ||
|
||
{% set state = order.paymentState %} | ||
|
||
{% if state != 'cart' %} | ||
{% include "@SyliusShop/Common/Order/Label/PaymentState/orderPaymentState.html.twig" %} | ||
{% endif %} | ||
|
||
{% for payment in order.payments %} | ||
{% set state = payment.state %} | ||
|
||
<div class="ui small icon message"> | ||
<i class="payment icon"></i> | ||
<div class="content"> | ||
<div class="header" id="sylius-payment-method" {{ sylius_test_html_attribute('payment-method') }}> | ||
{{ payment.method }} | ||
</div> | ||
<p {{ sylius_test_html_attribute('payment-price') }}>{{ money.format(payment.amount, payment.currencyCode) }}</p> | ||
{% if payment.amount != payment.order.total and state == 'processing' %} | ||
<i>{{ 'sylius.pay_pal.different_amount'|trans }}</i> | ||
{% endif %} | ||
{% if state != 'cart' %} | ||
<p id="payment-status" {{ sylius_test_html_attribute('payment-state') }}> | ||
{% include "@SyliusShop/Common/Order/Label/PaymentState/singlePaymentState.html.twig" with { 'state': state } %} | ||
</p> | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endfor %} |
40 changes: 40 additions & 0 deletions
40
templates/bundles/SyliusShopBundle/Order/thankYou.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{% extends '@SyliusShop/layout.html.twig' %} | ||
|
||
{% block content %} | ||
<div class="ui hidden divider"></div> | ||
<div class="ui grid"> | ||
<div class="center aligned sixteen wide column"> | ||
<h1 class="ui icon header"> | ||
{% set lastPayment = order.payments.last() %} | ||
<i class="circular rocket icon"></i> | ||
<div class="content" id="sylius-thank-you" {{ sylius_test_html_attribute('thank-you') }}> | ||
{{ 'sylius.ui.thank_you'|trans }} | ||
<div class="sub header">{{ 'sylius.ui.placed_an_order'|trans }}</div> | ||
</div> | ||
</h1> | ||
|
||
{{ sylius_template_event('sylius.shop.order.thank_you.after_message', {'order': order}) }} | ||
|
||
{% if lastPayment != false %} | ||
{% if lastPayment.method.instructions is not null %} | ||
<div id="sylius-payment-method-instructions" class="ui segment" {{ sylius_test_html_attribute('payment-method-instructions') }}> | ||
{{ lastPayment.method.instructions }} | ||
</div> | ||
{% endif %} | ||
<div class="ui hidden divider"></div> | ||
{% endif %} | ||
|
||
{% if order.customer.user is not null %} | ||
<a href="{{ path('sylius_shop_account_order_show', {'number': order.number}) }}" id="sylius-show-order-in-account" class="ui large blue button" {{ sylius_test_html_attribute('show-order-in-account') }}>{{ 'sylius.ui.view_order'|trans }}</a> | ||
{% else %} | ||
{% if lastPayment.state != 'completed' %} | ||
<a href="{{ path('sylius_shop_order_show', {'tokenValue': order.tokenValue}) }}" id="payment-method-page" class="ui large blue button" {{ sylius_test_html_attribute('payment-method-page') }}>{{ 'sylius.ui.change_payment_method'|trans }}</a> | ||
{% endif %} | ||
<a href="{{ path('sylius_shop_register_after_checkout', {'tokenValue': order.tokenValue}) }}" class="ui large green button" {{ sylius_test_html_attribute('create-an-account') }}> | ||
<i class="signup icon"></i> | ||
{{ 'sylius.ui.create_an_account'|trans }} | ||
</a> | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endblock %} |