├── .wp-env.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── assets ├── slick-carousel │ ├── slick.css │ ├── slick.js │ ├── slick.min.css │ └── slick.min.js └── tippy.js │ ├── tippy.all.js │ ├── tippy.all.js.map │ └── tippy.all.min.js ├── composer.json ├── css ├── admin-about.css ├── admin-about.css.map ├── admin-about.min.css ├── admin-tour.css ├── admin-tour.css.map ├── admin-tour.min.css ├── admin.css ├── admin.css.map ├── admin.min.css ├── card-slider.css ├── card-slider.css.map ├── card-slider.min.css ├── redirect.css ├── redirect.css.map └── redirect.min.css ├── fonts └── dist │ ├── pronamic-pay-icons.css │ ├── pronamic-pay-icons.eot │ ├── pronamic-pay-icons.html │ ├── pronamic-pay-icons.svg │ ├── pronamic-pay-icons.ttf │ ├── pronamic-pay-icons.woff │ └── pronamic-pay-icons.woff2 ├── images └── dist │ ├── cards │ ├── abn-amro │ │ ├── card-abn-amro-background-480x270.svg │ │ └── card-abn-amro-logo-_x80.svg │ ├── american-express │ │ ├── card-american-express-background-480x270.svg │ │ └── card-american-express-logo-_x80.svg │ ├── asn-bank │ │ ├── card-asn-bank-background-480x270.svg │ │ └── card-asn-bank-logo-_x80.svg │ ├── bunq │ │ ├── card-bunq-background-480x270.svg │ │ └── card-bunq-logo-_x80.svg │ ├── carta-si │ │ ├── card-carta-si-background-480x270.svg │ │ └── card-carta-si-logo-_x80.svg │ ├── carte-bleue │ │ ├── card-carte-bleue-background-480x270.svg │ │ └── card-carte-bleue-logo-_x80.svg │ ├── dankort │ │ ├── card-dankort-background-480x270.svg │ │ └── card-dankort-logo-_x80.svg │ ├── diners-club │ │ ├── card-diners-club-background-480x270.svg │ │ └── card-diners-club-logo-_x80.svg │ ├── discover │ │ ├── card-discover-background-480x270.svg │ │ └── card-discover-logo-_x80.svg │ ├── handelsbanken │ │ ├── card-handelsbanken-background-480x270.svg │ │ └── card-handelsbanken-logo-_x80.svg │ ├── ing │ │ ├── card-ing-background-480x270.svg │ │ └── card-ing-logo-_x80.svg │ ├── jcb │ │ ├── card-jcb-background-480x270.svg │ │ └── card-jcb-logo-_x80.svg │ ├── knab │ │ ├── card-knab-background-480x270.svg │ │ └── card-knab-logo-_x80.svg │ ├── maestro │ │ ├── card-maestro-background-480x270.svg │ │ └── card-maestro-logo-_x80.svg │ ├── mastercard │ │ ├── card-mastercard-background-480x270.svg │ │ └── card-mastercard-logo-_x80.svg │ ├── rabobank │ │ ├── card-rabobank-background-480x270.svg │ │ └── card-rabobank-logo-_x80.svg │ ├── regiobank │ │ ├── card-regiobank-background-480x270.svg │ │ └── card-regiobank-logo-_x80.svg │ ├── sns │ │ ├── card-sns-background-480x270.svg │ │ └── card-sns-logo-_x80.svg │ ├── triodos-bank │ │ ├── card-triodos-bank-background-480x270.svg │ │ └── card-triodos-bank-logo-_x80.svg │ ├── unionpay │ │ ├── card-unionpay-background-480x270.svg │ │ └── card-unionpay-logo-_x80.svg │ ├── van-lanschot │ │ ├── card-van-lanschot-background-480x270.svg │ │ └── card-van-lanschot-logo-_x80.svg │ └── visa │ │ ├── card-visa-background-480x270.svg │ │ └── card-visa-logo-_x80.svg │ ├── wp-pay-512.pngquant-min.png │ ├── wp-pay-white-512.pngquant-min.png │ ├── wp-pay-white.svgo-min.svg │ ├── wp-pay-wp-admin-fresh-base.svgo-min.svg │ └── wp-pay.svgo-min.svg ├── includes └── functions.php ├── js └── dist │ ├── admin-cb.js │ ├── admin-cb.min.js │ ├── admin-test.js │ ├── admin-test.min.js │ ├── admin-tour.js │ ├── admin-tour.min.js │ ├── admin.js │ ├── admin.min.js │ ├── subscription-mandate.js │ └── subscription-mandate.min.js ├── json-schemas └── payment.json ├── package.json ├── pronamic-pay-core.php ├── src ├── AbstractDataStoreCPT.php ├── AbstractGatewayIntegration.php ├── AbstractIntegration.php ├── AbstractPluginIntegration.php ├── ActionSchedulerController.php ├── Address.php ├── AddressHelper.php ├── Admin │ ├── AdminAboutPage.php │ ├── AdminDashboard.php │ ├── AdminGatewayPostType.php │ ├── AdminHealth.php │ ├── AdminModule.php │ ├── AdminNotification.php │ ├── AdminPaymentBulkActions.php │ ├── AdminPaymentPostType.php │ ├── AdminSettings.php │ ├── AdminSubscriptionPostType.php │ ├── AdminTour.php │ └── Install.php ├── Banks │ ├── BankAccountDetails.php │ └── BankTransferDetails.php ├── Blocks │ └── BlocksModule.php ├── Cards.php ├── ContactName.php ├── ContactNameHelper.php ├── Core │ ├── Gateway.php │ ├── GatewayConfig.php │ ├── IdTrait.php │ ├── ModeTrait.php │ ├── PaymentMethod.php │ ├── PaymentMethods.php │ ├── PaymentMethodsCollection.php │ ├── SupportsTrait.php │ ├── TimestampsTrait.php │ ├── Util.php │ ├── VersionTrait.php │ └── XML │ │ └── Util.php ├── Country.php ├── CreditCard.php ├── Customer.php ├── CustomerHelper.php ├── Dependencies │ ├── Dependencies.php │ ├── Dependency.php │ ├── PhpDependency.php │ ├── PhpExtensionDependency.php │ └── WordPressDependency.php ├── Fields │ ├── CachedCallbackOptions.php │ ├── DateField.php │ ├── Field.php │ ├── IDealIssuerSelectField.php │ ├── SelectField.php │ ├── SelectFieldOption.php │ ├── SelectFieldOptionGroup.php │ └── TextField.php ├── GatewayIntegrations.php ├── GatewayPostType.php ├── Gateways │ └── GatewaysDataStoreCPT.php ├── Gender.php ├── HomeUrlController.php ├── HouseNumber.php ├── LicenseManager.php ├── MergeTags │ ├── MergeTag.php │ └── MergeTagsController.php ├── MoneyJsonTransformer.php ├── PagesController.php ├── Payments │ ├── FailureReason.php │ ├── LegacyPaymentsDataStoreCPT.php │ ├── Payment.php │ ├── PaymentInfo.php │ ├── PaymentInfoHelper.php │ ├── PaymentInfoTrait.php │ ├── PaymentLine.php │ ├── PaymentLineType.php │ ├── PaymentLines.php │ ├── PaymentMergeTagsController.php │ ├── PaymentPostType.php │ ├── PaymentStatus.php │ ├── PaymentsDataStoreCPT.php │ ├── PaymentsModule.php │ ├── PaymentsPrivacy.php │ ├── SourceTrait.php │ └── StatusChecker.php ├── Plugin.php ├── Privacy │ └── AnonymizedTrait.php ├── PrivacyManager.php ├── Refunds │ ├── Refund.php │ ├── RefundLine.php │ └── RefundLines.php ├── Region.php ├── Settings.php ├── Subscriptions │ ├── AlignmentRule.php │ ├── Subscription.php │ ├── SubscriptionHelper.php │ ├── SubscriptionInterval.php │ ├── SubscriptionPeriod.php │ ├── SubscriptionPhase.php │ ├── SubscriptionPostType.php │ ├── SubscriptionStatus.php │ ├── SubscriptionsCompletionController.php │ ├── SubscriptionsDataStoreCPT.php │ ├── SubscriptionsFollowUpPaymentsController.php │ ├── SubscriptionsModule.php │ ├── SubscriptionsNotificationsController.php │ └── SubscriptionsPrivacy.php ├── TrackingModule.php ├── Upgrades │ ├── Upgrade.php │ └── Upgrades.php ├── Util.php ├── VatNumbers │ ├── VatNumber.php │ ├── VatNumberValidationService.php │ └── VatNumberValidity.php ├── VatRates.php └── Webhooks │ ├── WebhookLogger.php │ └── WebhookRequestInfo.php └── views ├── exception.php ├── form.php ├── meta-box-gateway-config.php ├── meta-box-gateway-payment-methods.php ├── meta-box-gateway-settings.php ├── meta-box-gateway-test.php ├── meta-box-gateway-webhook-log.php ├── meta-box-notes.php ├── meta-box-payment-info.php ├── meta-box-payment-lines.php ├── meta-box-payment-refunds.php ├── meta-box-payment-subscription.php ├── meta-box-payment-update.php ├── meta-box-subscription-info.php ├── meta-box-subscription-payments.php ├── meta-box-subscription-phases.php ├── meta-box-subscription-update.php ├── notice-license.php ├── page-dashboard.php ├── page-settings.php ├── pointer-dashboard.php ├── pointer-forms.php ├── pointer-gateways.php ├── pointer-payments.php ├── pointer-reports.php ├── pointer-settings.php ├── pointer-start.php ├── redirect-via-html.php ├── subscription-cancel.php ├── subscription-details.php ├── subscription-mandate-failed.php ├── subscription-mandate-updated.php ├── subscription-mandate.php ├── subscription-renew-failed.php ├── subscription-renew.php └── widget-payments-status-list.php /.wp-env.json: -------------------------------------------------------------------------------- 1 | { 2 | "core": null, 3 | "plugins": [ 4 | "pronamic/wp-env-quick-login", 5 | "https://downloads.wordpress.org/plugin/pronamic-client.zip", 6 | "https://downloads.wordpress.org/plugin/query-monitor.zip", 7 | "https://downloads.wordpress.org/plugin/plugin-check.zip" 8 | ], 9 | "mappings": { 10 | "wp-content/plugins/pronamic-pay-core": "./" 11 | }, 12 | "config": { 13 | "PRONAMIC_PAY_DEBUG": true 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | WordPress Pay » Core 4 | 5 |

6 | 7 |

WordPress Pay » Core

8 | 9 |

10 | The WordPress payment processing library is intended to make payments and integrations with payment providers easier to set up and maintain within WordPress. It has similarities to libraries like https://github.com/Payum/Payum and https://github.com/thephpleague/omnipay, but is more focused on WordPress. The code complies with the WordPress Coding Standards and the WordPress APIs are used. 11 |

12 | 13 | ## Table of contents 14 | 15 | - [Status](#status) 16 | - [CLI](#cli) 17 | - [WordPress Filters](#wordpress-filters) 18 | 19 | ## Status 20 | 21 | [![Latest Stable Version](https://poser.pugx.org/wp-pay/core/v/stable.svg)](https://packagist.org/packages/wp-pay/core) 22 | [![Total Downloads](https://poser.pugx.org/wp-pay/core/downloads.svg)](https://packagist.org/packages/wp-pay/core) 23 | [![Latest Unstable Version](https://poser.pugx.org/wp-pay/core/v/unstable.svg)](https://packagist.org/packages/wp-pay/core) 24 | [![License](https://poser.pugx.org/wp-pay/core/license.svg)](https://packagist.org/packages/wp-pay/core) 25 | [![Built with Grunt](http://cdn.gruntjs.com/builtwith.svg)](http://gruntjs.com/) 26 | 27 | ## CLI 28 | 29 | ### Check pending payment status 30 | 31 | ``` 32 | wp pay payment status $( wp post list --field=ID --post_type=pronamic_payment --post_status=payment_pending --order=ASC --orderby=date --posts_per_page=100 --paged=1 ) 33 | ``` 34 | 35 | ## WordPress Filters 36 | 37 | ### pronamic_payment_gateway_configuration_id 38 | 39 | ```php 40 | \add_filter( 41 | 'pronamic_payment_gateway_configuration_id', 42 | /** 43 | * Filter the payment gateway configuration ID to use specific 44 | * gateways for certain WooCommerce billing countries. 45 | * 46 | * @param int $configuration_id Gateway configuration ID. 47 | * @param Payment $payment The payment resource data. 48 | * @return int Gateway configuration ID. 49 | */ 50 | function( $configuration_id, $payment ) { 51 | if ( 'woocommerce' !== $payment->get_source() ) { 52 | return $configuration_id; 53 | } 54 | 55 | $billing_address = $payment->get_billing_address(); 56 | 57 | if ( null === $billing_address ) { 58 | return $configuration_id; 59 | } 60 | 61 | $id = $configuration_id; 62 | 63 | switch ( $billing_address->get_country_code() ) { 64 | case 'US': 65 | $id = \get_option( 'custom_us_gateway_configuration_id', $id ); 66 | break; 67 | case 'AU': 68 | $id = \get_option( 'custom_au_gateway_configuration_id', $id ); 69 | break; 70 | } 71 | 72 | if ( 'pronamic_gateway' === \get_post_type( $id ) && 'publish' === \get_post_status( $id ) ) { 73 | $configuration_id = $id; 74 | } 75 | 76 | return $configuration_id; 77 | }, 78 | 10, 79 | 2 80 | ); 81 | ``` 82 | 83 | ### pronamic_gateway_configuration_display_value 84 | 85 | ```php 86 | \add_filter( 87 | 'pronamic_gateway_configuration_display_value', 88 | function( $display_value, $post_id ) { 89 | return \get_post_meta( $post_id, '_pronamic_gateway_display_value', true ); 90 | }, 91 | 10, 92 | 2 93 | ); 94 | ``` 95 | 96 | ### pronamic_gateway_configuration_display_value_$id 97 | 98 | ```php 99 | \add_filter( 100 | 'pronamic_gateway_configuration_display_value_payvision', 101 | function( $display_value, $post_id ) { 102 | return \get_post_meta( $post_id, '_pronamic_gateway_payvision_business_id', true ); 103 | }, 104 | 10, 105 | 2 106 | ); 107 | ``` 108 | 109 | [![Pronamic - Work with us](https://github.com/pronamic/brand-resources/blob/main/banners/pronamic-work-with-us-leaderboard-728x90%404x.png)](https://www.pronamic.eu/contact/) 110 | -------------------------------------------------------------------------------- /assets/slick-carousel/slick.css: -------------------------------------------------------------------------------- 1 | /* Slider */ 2 | .slick-slider 3 | { 4 | position: relative; 5 | 6 | display: block; 7 | box-sizing: border-box; 8 | 9 | -webkit-user-select: none; 10 | -moz-user-select: none; 11 | -ms-user-select: none; 12 | user-select: none; 13 | 14 | -webkit-touch-callout: none; 15 | -khtml-user-select: none; 16 | -ms-touch-action: pan-y; 17 | touch-action: pan-y; 18 | -webkit-tap-highlight-color: transparent; 19 | } 20 | 21 | .slick-list 22 | { 23 | position: relative; 24 | 25 | display: block; 26 | overflow: hidden; 27 | 28 | margin: 0; 29 | padding: 0; 30 | } 31 | .slick-list:focus 32 | { 33 | outline: none; 34 | } 35 | .slick-list.dragging 36 | { 37 | cursor: pointer; 38 | cursor: hand; 39 | } 40 | 41 | .slick-slider .slick-track, 42 | .slick-slider .slick-list 43 | { 44 | -webkit-transform: translate3d(0, 0, 0); 45 | -moz-transform: translate3d(0, 0, 0); 46 | -ms-transform: translate3d(0, 0, 0); 47 | -o-transform: translate3d(0, 0, 0); 48 | transform: translate3d(0, 0, 0); 49 | } 50 | 51 | .slick-track 52 | { 53 | position: relative; 54 | top: 0; 55 | left: 0; 56 | 57 | display: block; 58 | margin-left: auto; 59 | margin-right: auto; 60 | } 61 | .slick-track:before, 62 | .slick-track:after 63 | { 64 | display: table; 65 | 66 | content: ''; 67 | } 68 | .slick-track:after 69 | { 70 | clear: both; 71 | } 72 | .slick-loading .slick-track 73 | { 74 | visibility: hidden; 75 | } 76 | 77 | .slick-slide 78 | { 79 | display: none; 80 | float: left; 81 | 82 | height: 100%; 83 | min-height: 1px; 84 | } 85 | [dir='rtl'] .slick-slide 86 | { 87 | float: right; 88 | } 89 | .slick-slide img 90 | { 91 | display: block; 92 | } 93 | .slick-slide.slick-loading img 94 | { 95 | display: none; 96 | } 97 | .slick-slide.dragging img 98 | { 99 | pointer-events: none; 100 | } 101 | .slick-initialized .slick-slide 102 | { 103 | display: block; 104 | } 105 | .slick-loading .slick-slide 106 | { 107 | visibility: hidden; 108 | } 109 | .slick-vertical .slick-slide 110 | { 111 | display: block; 112 | 113 | height: auto; 114 | 115 | border: 1px solid transparent; 116 | } 117 | .slick-arrow.slick-hidden { 118 | display: none; 119 | } 120 | -------------------------------------------------------------------------------- /assets/slick-carousel/slick.min.css: -------------------------------------------------------------------------------- 1 | .slick-slider{position:relative;display:block;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none;-khtml-user-select:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-tap-highlight-color:transparent}.slick-list{position:relative;display:block;overflow:hidden;margin:0;padding:0}.slick-list:focus{outline:0}.slick-list.dragging{cursor:pointer;cursor:hand}.slick-slider .slick-list,.slick-slider .slick-track{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.slick-track{position:relative;top:0;left:0;display:block;margin-left:auto;margin-right:auto}.slick-track:after,.slick-track:before{display:table;content:''}.slick-track:after{clear:both}.slick-loading .slick-track{visibility:hidden}.slick-slide{display:none;float:left;height:100%;min-height:1px}[dir=rtl] .slick-slide{float:right}.slick-slide img{display:block}.slick-slide.slick-loading img{display:none}.slick-slide.dragging img{pointer-events:none}.slick-initialized .slick-slide{display:block}.slick-loading .slick-slide{visibility:hidden}.slick-vertical .slick-slide{display:block;height:auto;border:1px solid transparent}.slick-arrow.slick-hidden{display:none} -------------------------------------------------------------------------------- /css/admin-about.css: -------------------------------------------------------------------------------- 1 | .pronamic-pay-badge { 2 | background-color: #ffb200; 3 | background-image: url("../images/dist/wp-pay-white-512.pngquant-min.png"); 4 | color: #fff0cc; 5 | } 6 | 7 | .svg .pronamic-pay-badge { 8 | background-image: url("../images/dist/wp-pay-white.svgo-min.svg"); 9 | } 10 | 11 | /*# sourceMappingURL=admin-about.css.map */ 12 | -------------------------------------------------------------------------------- /css/admin-about.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sourceRoot":"","sources":["../scss/admin-about.scss","../scss/admin/_variables.scss"],"names":[],"mappings":"AAGA;EACC,kBCyEe;EDxEf;EAEA;;;AAIA;EACC","file":"admin-about.css"} -------------------------------------------------------------------------------- /css/admin-about.min.css: -------------------------------------------------------------------------------- 1 | .pronamic-pay-badge{background-color:#ffb200;background-image:url(../images/dist/wp-pay-white-512.pngquant-min.png);color:#fff0cc}.svg .pronamic-pay-badge{background-image:url(../images/dist/wp-pay-white.svgo-min.svg)} 2 | -------------------------------------------------------------------------------- /css/admin-tour.css: -------------------------------------------------------------------------------- 1 | .pp-pointer-buttons .button, 2 | .pp-pointer-buttons .button-primary, 3 | .pp-pointer-buttons .button-secondary { 4 | margin-right: 10px; 5 | } 6 | .pp-pointer-buttons .button:last-child, 7 | .pp-pointer-buttons .button-primary:last-child, 8 | .pp-pointer-buttons .button-secondary:last-child { 9 | margin-right: 0; 10 | } 11 | .pp-pointer-buttons a { 12 | float: none; 13 | } 14 | 15 | .pp-pointer-buttons-right { 16 | float: right; 17 | } 18 | 19 | /*# sourceMappingURL=admin-tour.css.map */ 20 | -------------------------------------------------------------------------------- /css/admin-tour.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sourceRoot":"","sources":["../scss/admin-tour.scss"],"names":[],"mappings":"AAEC;AAAA;AAAA;EAGC;;AAEA;AAAA;AAAA;EACC;;AAIF;EACC;;;AAIF;EACC","file":"admin-tour.css"} -------------------------------------------------------------------------------- /css/admin-tour.min.css: -------------------------------------------------------------------------------- 1 | .pp-pointer-buttons .button,.pp-pointer-buttons .button-primary,.pp-pointer-buttons .button-secondary{margin-right:10px}.pp-pointer-buttons .button-primary:last-child,.pp-pointer-buttons .button-secondary:last-child,.pp-pointer-buttons .button:last-child{margin-right:0}.pp-pointer-buttons a{float:none}.pp-pointer-buttons-right{float:right} 2 | -------------------------------------------------------------------------------- /css/admin.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sourceRoot":"","sources":["../fonts/src/_variables.scss","../scss/admin/_action-links.scss","../scss/admin/_buttons.scss","../scss/admin/_chart.scss","../scss/admin/_variables.scss","../scss/admin/_dashboard-widget-payments.scss","../scss/admin/_edit-form-post.scss","../scss/admin/_forms.scss","../scss/admin/_icons.scss","../scss/admin/_lists.scss","../scss/admin/_meta-box-gateway-config.scss","../scss/admin/_meta-box-gateway-test.scss","../scss/admin/_meta-box-payment-log.scss","../scss/admin/_meta-box-subscription-info.scss","../scss/admin/_meta-box-update.scss","../scss/admin/_settings.scss","../scss/admin/_tables.scss","../scss/admin/_tabs.scss","../scss/admin/_text.scss","../scss/admin/_tip.scss","../scss/admin/_utilities.scss"],"names":[],"mappings":"AAAA;ACAA;EACC;EAEA;EAEA;EAEA;;;AAGD;EACC;EAEA;EAEA;EAEA;EAEA;;AAEA;EACC;;;ACnBF;EACC;EAEA;;;ACFA;EACC;;;AAIF;EACC;EAEA;EAEA;;;AAGD;EACC,YCfO;EDiBP;EACA;EACA;EAEA;EAEA;EACA;;AAEA;EACC;EAEA;EAEA,OCvBK;EDyBL;EAEA;EACA;EAEA;EACA;;AAEA;EACC,oBCyDkC;;ADtDnC;EACC,oBCsD8B;;ADnD/B;EACC,oBCmDgC;;ADhDjC;EACC,oBCgDgC;;AD7CjC;EACC,oBC6C8B;;AD1C/B;EACC,oBC0C6B;;ADvC9B;EACC,oBCuCwB;EDrCxB;EAEA;;AAIF;EACC,OChDc;EDkDd;EAEA;EACA;EAEA;;;AEjFA;EACC;;;AAKH;EACC;EAEA;;AAEA;EACC;EAEA;EAEA,ODTK;ECWL;EAEA;EACA;EAEA;;AAEA;EACC,ODnBI;ECqBJ;EAEA;EAEA;EAEA;EAEA;;AAEA;EACC,ODTS;ECWT;EAEA;EACA;EAEA;;AAGD;EACC,ODlBe;;ACoBf;AAAA;EAEC,ODtBc;;AC2BjB;EACC;EAEA;;AAGD;EACC;;;AClED;EACC;;;ACLH;EACC;;;AAID;EACC;;;AAMA;EACC;EAEA;EAEA;EACA;EAEA;EAEA;EAEA;EACA;;;ACzBF;EACC;EAEA;EAEA;EACA;;AAEA;EACC,SREsB;EQAtB;EAEA;EAEA;EACA;EACA;EAEA;EAEA;EAEA;EACA;;;AAKD;EACC,OJmD2B;EIlD3B,SRrBmB;;;AQ0BpB;EACC,OJXS;EIYT,SRhCqB;;;AQqCtB;EACC,OJ0C8B;EIzC9B,SRlCsB;;;AQuCvB;EACC,OJsC6B;EIrC7B,SR7CqB;;;AQkDtB;EACC,OJjBc;EIkBd,SR/CoB;;;AQoDrB;EACC,OJ6B0B;EI5B1B,SR1DkB;;;AQ+DnB;EACC,OJ/Bc;EIgCd,SRhEmB;;;AQqEpB;EACC,OJtCc;EIuCd,SR3Ec;;;AQgFf;EACC,OJG6B;EIF7B,SRlFc;;;AQuFf;EACC,OJpDc;EIqDd,SR1FkB;;;ASFlB;EACC;EACA;EACA;EACA;EACA;;AAMA;EACC;;AAKH;EACC;;AAIA;EACC,OL6D6B;;AKxD9B;EACC,OLpBI;;;AKyBP;EAGG;IACC;;EAEA;IACC;;EAIF;IACC;;;AC7CH;EACC;;AAGD;EACC;;AAEA;EACC;;;ACRD;EACC;;;ACDD;EACC;EACA;;AAIF;EACC;;;ACPA;EACC;;;ACDF;AAAA;EACC;EACA;;;AAIF;EACC;;;AAGD;EACC,YVkD8C;EUhD9C;EAEA;;;AAGD;EACC;EAEA;;;AAGD;AAAA;EAEC;;;AAGD;AAAA;EAEC;;;AChCA;EAEC;;;ACJF;EACC;;;AAKC;EACC;;AAKD;AAAA;EAEC,OZHI;;AYQL;EACC;;AAEA;EACC;;;AAQH;EACC;;;AAQC;EACC,YZegC;;;AYPnC;EACC,YZMkC;;;AYCjC;EACC;EACA;EACA;EACA;EACA;;;AAOJ;EACC;;AAIE;EACC;;;AAOH;EACC;;;AAOD;AAAA;AAAA;EAGC;;AAGD;AAAA;EAEC;;;AAIF;EAUK;IAKC;;EAEA;IACC;;EAOD;IAKC;;;ACnIP;EACC;EAEA;EAEA;EAEA;EAEA;;AAEA;EACC,YbsCwB;EapCxB;EACA;EAEA;EAEA;EAEA;EAEA;EACA;;AAEA;EACC,YbzBK;Ea2BL;EAEA;;;AAqBC;EACC,kBAjBa;;;AAgBd;EACC,kBAjBa;;;AAgBd;EACC,kBAjBa;;;AAgBd;EACC,kBAjBa;;;AAgBd;EACC,kBAjBa;;;AAgBd;EACC,kBAjBa;;;AAgBd;EACC,kBAjBa;;;AAgBd;EACC,kBAjBa;;;AAgBd;EACC,kBAjBa;;;AAwBlB;EACC;EACA;EAEA;;AAGA;EAEC;;AAEA;EAEC;;;AAKH;EACC;;;AAGD;EACC;IACC;;EAGD;IACC;;EAEA;IACC;;;AAKH;EAGG;AAAA;IAEC;;;AClGJ;EACC;;;AAGD;EACC,OdFK;;;AcKN;EACC,OdJQ;;;AcOT;EACC;;;ACfC;EACC,OfkBS;EehBT;;;AAOD;EACC;;;ACXH;EACC","file":"admin.css"} -------------------------------------------------------------------------------- /css/card-slider.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sourceRoot":"","sources":["../scss/card-slider.scss"],"names":[],"mappings":";AAEC;AAAA;EACC;;AAGD;AAAA;AAAA;AAAA;EAEC;;;AAIF;AAAA;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGD;EACC;EACA;;;AAGD;EACC;;AAEA;EACC;;;AAIF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;;AAKH;EACC;EACA;;AAGC;EACC;;AAKH;EACC;;AAGD;AAAA;EAEC;;AAGD;EACC;EACA;EACA;EACA;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;;AAEA;EACC;EACA;;AAIF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAIA;EACC;;AAKD;EACC;;AAKD;EACC;;AAKD;EACC;;AAKD;EACC;;AAGD;EACC;;AAKD;EACC;;AAGD;EACC;;AAKD;EACC;;AAKD;EACC;;AAKD;EACC;;AAGD;EACC;;AAKD;EACC;;AAGD;EACC;;AAKD;EACC;;AAKD;EACC;;AAGD;EACC;;AAKD;EACC;;AAGD;EACC;EACA;;AAKD;EACC;;AAKD;EACC;;AAKD;EACC;;AAGD;EACC;;AAKD;EACC;;AAGD;EACC;;AAGD;EACC;;AAKD;EACC;;AAGD;EACC;;AAKD;EACC;;AAGD;EACC;;AAKD;EACC;;AAKD;EACC;;AAGD;EACC;;AAKD;EACC;;;AAMH;EACC;EACA;;AAGC;EACC;;;AAKH;EACC;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGD;EAEC;;AAEA;EACC;;AAKH;EACC;EACA","file":"card-slider.css"} -------------------------------------------------------------------------------- /css/redirect.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #f6f6f6; 3 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 4 | } 5 | 6 | .pronamic-pay-redirect-page { 7 | margin: 0 auto; 8 | max-width: 750px; 9 | } 10 | 11 | .pronamic-pay-redirect-container { 12 | background: #f6f6f6; 13 | margin: 30px auto; 14 | padding: 20px; 15 | text-align: center; 16 | } 17 | .pronamic-pay-redirect-container h1 { 18 | margin: 0; 19 | } 20 | .pronamic-pay-redirect-container::after { 21 | clear: both; 22 | content: ""; 23 | display: table; 24 | } 25 | .pronamic-pay-redirect-container > p { 26 | color: #777; 27 | } 28 | .pronamic-pay-redirect-container .pp-page-section-container * { 29 | box-sizing: border-box; 30 | } 31 | .pronamic-pay-redirect-container .pp-page-section-container .pp-page-section-wrapper { 32 | background: #fff; 33 | border-radius: 20px; 34 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.1); 35 | color: #333; 36 | max-width: 600px; 37 | margin: 3em auto 0 auto; 38 | padding: 40px; 39 | } 40 | .pronamic-pay-redirect-container .pp-page-section-container .pp-page-section-wrapper h2 { 41 | margin-top: 0; 42 | } 43 | .pronamic-pay-redirect-container .pp-page-section-container .pp-page-section-wrapper dl { 44 | display: flex; 45 | flex-flow: row wrap; 46 | } 47 | .pronamic-pay-redirect-container .pp-page-section-container .pp-page-section-wrapper dl dt, .pronamic-pay-redirect-container .pp-page-section-container .pp-page-section-wrapper dl dd { 48 | float: left; 49 | padding-bottom: 5px; 50 | } 51 | .pronamic-pay-redirect-container .pp-page-section-container .pp-page-section-wrapper dl dt { 52 | flex-basis: 30%; 53 | font-weight: bold; 54 | } 55 | .pronamic-pay-redirect-container .pp-page-section-container .pp-page-section-wrapper dl dd { 56 | flex-basis: 70%; 57 | margin-inline-start: 0; 58 | } 59 | .pronamic-pay-redirect-container input[type=submit], 60 | .pronamic-pay-redirect-container select { 61 | padding: 10px 20px; 62 | } 63 | .pronamic-pay-redirect-container input[type=submit] { 64 | background: #2271b1; 65 | border: none; 66 | border-radius: 3px; 67 | color: #fff; 68 | cursor: pointer; 69 | font-size: 1.25em; 70 | font-weight: 300; 71 | letter-spacing: 0.05rem; 72 | white-space: normal; 73 | } 74 | .pronamic-pay-redirect-container input[type=submit]:hover { 75 | background-color: #135e96; 76 | } 77 | @media (max-width: 600px) { 78 | .pronamic-pay-redirect-container input[type=submit] { 79 | font-size: 3.5vw; 80 | } 81 | } 82 | 83 | hr { 84 | background: #c3c3c3; 85 | border: 0; 86 | margin: 2em auto; 87 | width: 60%; 88 | height: 1px; 89 | } 90 | 91 | #pronamic_ideal_form label { 92 | display: block; 93 | font-weight: bold; 94 | margin-bottom: 0.5em; 95 | } 96 | #pronamic_ideal_form p .pronamic-pay-btn { 97 | margin-top: 0.5em; 98 | } 99 | 100 | .alignleft { 101 | text-align: left; 102 | } 103 | 104 | /*# sourceMappingURL=redirect.css.map */ 105 | -------------------------------------------------------------------------------- /css/redirect.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sourceRoot":"","sources":["../scss/redirect.scss"],"names":[],"mappings":"AAaA;EACC,YAX8B;EAa9B;;;AAGD;EACC;EAEA;;;AAGD;EACC,YAvB8B;EAyB9B;EACA;EAEA;;AAEA;EACC;;AAGD;EACC;EACA;EACA;;AAGD;EACC,OArCU;;AAyCV;EACC;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;;AAGD;EACC;EACA;;AAEA;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;;AAMJ;AAAA;EAEC;;AAGD;EACC,YAnFmC;EAoFnC;EACA;EACA,OA/FM;EAgGN;EACA;EACA;EACA;EACA;;AAEA;EACC,kBA7FwC;;AAiG1C;EACC;IACC;;;;AAKH;EACC,YA/GY;EAiHZ;EAEA;EAEA;EACA;;;AAIA;EACC;EAEA;EAEA;;AAIA;EACC;;;AAKH;EACC","file":"redirect.css"} -------------------------------------------------------------------------------- /css/redirect.min.css: -------------------------------------------------------------------------------- 1 | body{background:#f6f6f6;font-family:Helvetica Neue,Helvetica,Arial,sans-serif}.pronamic-pay-redirect-page{margin:0 auto;max-width:750px}.pronamic-pay-redirect-container{background:#f6f6f6;margin:30px auto;padding:20px;text-align:center}.pronamic-pay-redirect-container h1{margin:0}.pronamic-pay-redirect-container:after{clear:both;content:"";display:table}.pronamic-pay-redirect-container>p{color:#777}.pronamic-pay-redirect-container .pp-page-section-container *{-webkit-box-sizing:border-box;box-sizing:border-box}.pronamic-pay-redirect-container .pp-page-section-container .pp-page-section-wrapper{background:#fff;border-radius:20px;-webkit-box-shadow:0 0 20px rgba(0,0,0,.1);box-shadow:0 0 20px rgba(0,0,0,.1);color:#333;max-width:600px;margin:3em auto 0;padding:40px}.pronamic-pay-redirect-container .pp-page-section-container .pp-page-section-wrapper h2{margin-top:0}.pronamic-pay-redirect-container .pp-page-section-container .pp-page-section-wrapper dl{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap}.pronamic-pay-redirect-container .pp-page-section-container .pp-page-section-wrapper dl dd,.pronamic-pay-redirect-container .pp-page-section-container .pp-page-section-wrapper dl dt{float:left;padding-bottom:5px}.pronamic-pay-redirect-container .pp-page-section-container .pp-page-section-wrapper dl dt{-ms-flex-preferred-size:30%;flex-basis:30%;font-weight:700}.pronamic-pay-redirect-container .pp-page-section-container .pp-page-section-wrapper dl dd{-ms-flex-preferred-size:70%;flex-basis:70%;-webkit-margin-start:0;margin-inline-start:0}.pronamic-pay-redirect-container input[type=submit],.pronamic-pay-redirect-container select{padding:10px 20px}.pronamic-pay-redirect-container input[type=submit]{background:#2271b1;border:none;border-radius:3px;color:#fff;cursor:pointer;font-size:1.25em;font-weight:300;letter-spacing:.05rem}.pronamic-pay-redirect-container input[type=submit]:hover{background-color:#135e96}hr{background:#c3c3c3;border:0;margin:2em auto;width:60%;height:1px}#pronamic_ideal_form label{display:block;font-weight:700;margin-bottom:.5em}#pronamic_ideal_form p .pronamic-pay-btn{margin-top:.5em}.alignleft{text-align:left} 2 | -------------------------------------------------------------------------------- /fonts/dist/pronamic-pay-icons.css: -------------------------------------------------------------------------------- 1 | /* Generated by grunt-webfont */ 2 | 3 | 4 | 5 | @font-face { 6 | font-family:"Pronamic Pay Icons"; 7 | src:url("pronamic-pay-icons.eot?90e24a9302e93ce8bcdcfcae23956ece"); 8 | src:url("pronamic-pay-icons.eot?90e24a9302e93ce8bcdcfcae23956ece#iefix") format("embedded-opentype"), 9 | url("pronamic-pay-icons.woff2?90e24a9302e93ce8bcdcfcae23956ece") format("woff2"), 10 | url("pronamic-pay-icons.woff?90e24a9302e93ce8bcdcfcae23956ece") format("woff"), 11 | url("pronamic-pay-icons.ttf?90e24a9302e93ce8bcdcfcae23956ece") format("truetype"), 12 | url("pronamic-pay-icons.svg?90e24a9302e93ce8bcdcfcae23956ece#pronamic-pay-icons") format("svg"); 13 | font-weight:normal; 14 | font-style:normal; 15 | } 16 | 17 | .pronamic-pay-icon { 18 | 19 | font-family:"Pronamic Pay Icons"; 20 | 21 | display:inline-block; 22 | line-height:1; 23 | font-weight:normal; 24 | font-style:normal; 25 | speak:none; 26 | text-decoration:inherit; 27 | text-transform:none; 28 | text-rendering:auto; 29 | -webkit-font-smoothing:antialiased; 30 | -moz-osx-font-smoothing:grayscale; 31 | } 32 | 33 | 34 | /* Icons */ 35 | 36 | 37 | .pronamic-pay-icon-ideal:before { 38 | content:"\f101"; 39 | } 40 | 41 | 42 | .pronamic-pay-icon-pay:before { 43 | content:"\f102"; 44 | } 45 | 46 | 47 | .pronamic-pay-icon-pronamic:before { 48 | content:"\f103"; 49 | } 50 | 51 | 52 | .pronamic-pay-icon-question-mark:before { 53 | content:"\f104"; 54 | } 55 | 56 | 57 | .pronamic-pay-icon-recurring:before { 58 | content:"\f105"; 59 | } 60 | 61 | 62 | .pronamic-pay-icon-status-cancelled:before { 63 | content:"\f106"; 64 | } 65 | 66 | 67 | .pronamic-pay-icon-status-completed:before { 68 | content:"\f107"; 69 | } 70 | 71 | 72 | .pronamic-pay-icon-status-failed:before { 73 | content:"\f108"; 74 | } 75 | 76 | 77 | .pronamic-pay-icon-status-on-hold:before { 78 | content:"\f109"; 79 | } 80 | 81 | 82 | .pronamic-pay-icon-status-pending:before { 83 | content:"\f10a"; 84 | } 85 | 86 | 87 | .pronamic-pay-icon-status-processing:before { 88 | content:"\f10b"; 89 | } 90 | 91 | 92 | .pronamic-pay-icon-status-refunded:before { 93 | content:"\f10c"; 94 | } 95 | -------------------------------------------------------------------------------- /fonts/dist/pronamic-pay-icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pronamic/wp-pay-core/f1f6f9cb194de941c2563373207c4110cfd169d7/fonts/dist/pronamic-pay-icons.eot -------------------------------------------------------------------------------- /fonts/dist/pronamic-pay-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pronamic/wp-pay-core/f1f6f9cb194de941c2563373207c4110cfd169d7/fonts/dist/pronamic-pay-icons.ttf -------------------------------------------------------------------------------- /fonts/dist/pronamic-pay-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pronamic/wp-pay-core/f1f6f9cb194de941c2563373207c4110cfd169d7/fonts/dist/pronamic-pay-icons.woff -------------------------------------------------------------------------------- /fonts/dist/pronamic-pay-icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pronamic/wp-pay-core/f1f6f9cb194de941c2563373207c4110cfd169d7/fonts/dist/pronamic-pay-icons.woff2 -------------------------------------------------------------------------------- /images/dist/cards/abn-amro/card-abn-amro-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/abn-amro/card-abn-amro-logo-_x80.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/american-express/card-american-express-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/asn-bank/card-asn-bank-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/bunq/card-bunq-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/carta-si/card-carta-si-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/carta-si/card-carta-si-logo-_x80.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/carte-bleue/card-carte-bleue-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/carte-bleue/card-carte-bleue-logo-_x80.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/dankort/card-dankort-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/dankort/card-dankort-logo-_x80.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/diners-club/card-diners-club-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/discover/card-discover-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/discover/card-discover-logo-_x80.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/handelsbanken/card-handelsbanken-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/jcb/card-jcb-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/jcb/card-jcb-logo-_x80.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/knab/card-knab-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/knab/card-knab-logo-_x80.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/maestro/card-maestro-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/maestro/card-maestro-logo-_x80.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/mastercard/card-mastercard-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/rabobank/card-rabobank-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/regiobank/card-regiobank-logo-_x80.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/sns/card-sns-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/unionpay/card-unionpay-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/van-lanschot/card-van-lanschot-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/visa/card-visa-background-480x270.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/cards/visa/card-visa-logo-_x80.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/wp-pay-512.pngquant-min.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pronamic/wp-pay-core/f1f6f9cb194de941c2563373207c4110cfd169d7/images/dist/wp-pay-512.pngquant-min.png -------------------------------------------------------------------------------- /images/dist/wp-pay-white-512.pngquant-min.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pronamic/wp-pay-core/f1f6f9cb194de941c2563373207c4110cfd169d7/images/dist/wp-pay-white-512.pngquant-min.png -------------------------------------------------------------------------------- /images/dist/wp-pay-white.svgo-min.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/wp-pay-wp-admin-fresh-base.svgo-min.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /images/dist/wp-pay.svgo-min.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /js/dist/admin-cb.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Clipboard feature. 3 | * 4 | * Please note: this file deliberately does not have `clipboard.js` in its name, as this would 5 | * cause the WordPress Plugin Review Team to think that https://clipboardjs.com/ is included with 6 | * the plugin. 7 | * 8 | * @link https://github.com/pronamic/wp-pay-core/issues/209 9 | * 10 | * @link https://github.com/WordPress/WordPress/blob/68e3310c024d7fceb84a5028e955ad163de6bd45/wp-includes/js/plupload/handlers.js#L364-L393 11 | * @link https://translate.wordpress.org/projects/wp/dev/nl/default/?filters%5Bstatus%5D=either&filters%5Boriginal_id%5D=10763746&filters%5Btranslation_id%5D=91929960 12 | * @link https://translate.wordpress.org/projects/wp/dev/nl/default/?filters%5Bstatus%5D=either&filters%5Boriginal_id%5D=6831324&filters%5Btranslation_id%5D=58732256 13 | */ 14 | addEventListener( 'DOMContentLoaded', function () { 15 | const elements = document.querySelectorAll( '.pronamic-pay-clipboard' ); 16 | 17 | elements.forEach( function ( element ) { 18 | var clipboard = new ClipboardJS( element ), 19 | successTimeout; 20 | 21 | clipboard.on( 'success', function( event ) { 22 | var triggerElement = jQuery( event.trigger ), 23 | successElement = jQuery( '.success', triggerElement.closest( '.pronamic-pay-action-link-clipboard' ) ); 24 | 25 | event.clearSelection(); 26 | 27 | clearTimeout( successTimeout ); 28 | 29 | successElement.removeClass( 'hidden' ); 30 | 31 | successTimeout = setTimeout( function() { 32 | successElement.addClass( 'hidden' ); 33 | }, 3000 ); 34 | } ); 35 | } ); 36 | } ); 37 | -------------------------------------------------------------------------------- /js/dist/admin-cb.min.js: -------------------------------------------------------------------------------- 1 | addEventListener("DOMContentLoaded",(function(){document.querySelectorAll(".pronamic-pay-clipboard").forEach((function(e){var n;new ClipboardJS(e).on("success",(function(e){var o=jQuery(e.trigger),c=jQuery(".success",o.closest(".pronamic-pay-action-link-clipboard"));e.clearSelection(),clearTimeout(n),c.removeClass("hidden"),n=setTimeout((function(){c.addClass("hidden")}),3e3)}))}))})); -------------------------------------------------------------------------------- /js/dist/admin-test.js: -------------------------------------------------------------------------------- 1 | jQuery( document ).ready( function( $ ) { 2 | // Interval label. 3 | function set_interval_label() { 4 | var text = $( '#pronamic_pay_test_repeat_frequency :selected' ).data( 'interval-suffix' ); 5 | 6 | $( '#pronamic_pay_test_repeat_interval_suffix' ).text( text ); 7 | } 8 | 9 | $( '#pronamic_pay_test_repeat_frequency' ).change( function() { set_interval_label(); } ); 10 | 11 | set_interval_label(); 12 | 13 | // Ends on value. 14 | $( 'label[for^="pronamic_pay_ends_"] input' ).focus( function () { 15 | var radio_id = $( this ).parents( 'label' ).attr( 'for' ); 16 | 17 | $( '#' + radio_id ).prop( 'checked', true ); 18 | } ); 19 | } ); 20 | -------------------------------------------------------------------------------- /js/dist/admin-test.min.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready((function(e){function t(){var t=e("#pronamic_pay_test_repeat_frequency :selected").data("interval-suffix");e("#pronamic_pay_test_repeat_interval_suffix").text(t)}e("#pronamic_pay_test_repeat_frequency").change((function(){t()})),t(),e('label[for^="pronamic_pay_ends_"] input').focus((function(){var t=e(this).parents("label").attr("for");e("#"+t).prop("checked",!0)}))})); -------------------------------------------------------------------------------- /js/dist/admin-tour.js: -------------------------------------------------------------------------------- 1 | /* global pronamicPayAdminTour */ 2 | jQuery( document ).ready( function( $ ) { 3 | $.each( pronamicPayAdminTour.pointers, function() { 4 | var pointer = this; 5 | 6 | var options = $.extend( pointer.options, { 7 | buttons: function() { 8 | return false; 9 | } 10 | } ); 11 | 12 | $( pointer.selector ).first().pointer( options ).pointer( 'open' ); 13 | } ); 14 | } ); 15 | -------------------------------------------------------------------------------- /js/dist/admin-tour.min.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready((function(n){n.each(pronamicPayAdminTour.pointers,(function(){var t=n.extend(this.options,{buttons:function(){return!1}});n(this.selector).first().pointer(t).pointer("open")}))})); -------------------------------------------------------------------------------- /js/dist/subscription-mandate.js: -------------------------------------------------------------------------------- 1 | jQuery( document ).ready( function () { 2 | var $slider = jQuery( '.pp-card-slider' ).slick( { 3 | dots: true, 4 | arrows: false, 5 | infinite: false, 6 | slidesToShow: 1, 7 | centerMode: true, 8 | } ); 9 | 10 | $slider.find( '.slick-current input[type="radio"]' ).prop( 'checked', true ); 11 | 12 | $slider.find( '.slick-slide' ).on( 'click', function () { 13 | var index = jQuery( this ).data( 'slick-index' ); 14 | 15 | $slider.slick( 'slickGoTo', index ); 16 | } ); 17 | 18 | $slider.on( 'afterChange', function ( event, slick, currentSlide ) { 19 | $slider.find( 'input[type="radio"]' ).prop( 'checked', false ); 20 | 21 | $slider.find( '.slick-slide' ).eq( currentSlide ).find( 'input[type="radio"]' ).prop( 'checked', true ); 22 | } ); 23 | } ); 24 | -------------------------------------------------------------------------------- /js/dist/subscription-mandate.min.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready((function(){var i=jQuery(".pp-card-slider").slick({dots:!0,arrows:!1,infinite:!1,slidesToShow:1,centerMode:!0});i.find('.slick-current input[type="radio"]').prop("checked",!0),i.find(".slick-slide").on("click",(function(){var e=jQuery(this).data("slick-index");i.slick("slickGoTo",e)})),i.on("afterChange",(function(e,n,c){i.find('input[type="radio"]').prop("checked",!1),i.find(".slick-slide").eq(c).find('input[type="radio"]').prop("checked",!0)}))})); -------------------------------------------------------------------------------- /json-schemas/payment.json: -------------------------------------------------------------------------------- 1 | { 2 | "$id": "https://github.com/pronamic/wp-pay-core/blob/master/json-schemas/payment.json", 3 | "$schema": "http://json-schema.org/draft-07/schema#", 4 | "title": "Pronamic Pay payment.", 5 | "type": "object", 6 | "required": [] 7 | } 8 | -------------------------------------------------------------------------------- /pronamic-pay-core.php: -------------------------------------------------------------------------------- 1 | 22 | * @copyright 2005-2024 Pronamic 23 | * @license GPL-3.0-or-later 24 | * @package Pronamic\WordPress\Pay 25 | */ 26 | 27 | if ( ! defined( 'ABSPATH' ) ) { 28 | exit; 29 | } 30 | 31 | /** 32 | * Autoload. 33 | */ 34 | require_once __DIR__ . '/vendor/autoload_packages.php'; 35 | 36 | /** 37 | * Bootstrap. 38 | */ 39 | add_filter( 40 | 'pronamic_pay_modules', 41 | function ( $modules ) { 42 | $modules[] = 'forms'; 43 | $modules[] = 'subscriptions'; 44 | 45 | return $modules; 46 | } 47 | ); 48 | 49 | \Pronamic\WordPress\Pay\Plugin::instance( 50 | [ 51 | 'file' => __FILE__, 52 | 'action_scheduler' => __DIR__ . '/vendor/woocommerce/action-scheduler/action-scheduler.php', 53 | ] 54 | ); 55 | 56 | \Pronamic\WordPress\Pay\LicenseManager::instance(); 57 | -------------------------------------------------------------------------------- /src/AbstractPluginIntegration.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Gateways\Common 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay; 12 | 13 | use Pronamic\WordPress\Pay\Dependencies\Dependencies; 14 | use Pronamic\WordPress\Pay\Upgrades\Upgrades; 15 | 16 | /** 17 | * Title: Abstract plugin integration 18 | * Description: 19 | * Copyright: 2005-2024 Pronamic 20 | * Company: Pronamic 21 | * 22 | * @author Remco Tolsma 23 | * @version 2.2.6 24 | * @since 1.0.0 25 | * @link https://github.com/thephpleague/omnipay-common/blob/master/src/Omnipay/Common/AbstractGateway.php 26 | */ 27 | abstract class AbstractPluginIntegration extends AbstractIntegration { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/ActionSchedulerController.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay; 12 | 13 | /** 14 | * Action Scheduler Controller class 15 | */ 16 | class ActionSchedulerController { 17 | /** 18 | * Setup. 19 | * 20 | * @return void 21 | */ 22 | public function setup() { 23 | \add_action( 'action_scheduler_begin_execute', [ $this, 'begin_execute' ], 10, 2 ); 24 | } 25 | 26 | /** 27 | * Action scheduler begin execute. 28 | * 29 | * @link https://github.com/woocommerce/action-scheduler/blob/3.7.1/classes/abstracts/ActionScheduler_Abstract_QueueRunner.php#L84 30 | * @param int $action_id Action ID. 31 | * @param string $context Context. 32 | * @return void 33 | */ 34 | public function begin_execute( $action_id, $context ) { 35 | if ( \defined( 'PRONAMIC_ACTION_SCHEDULER_CONTEXT' ) ) { 36 | return; 37 | } 38 | 39 | \define( 'PRONAMIC_ACTION_SCHEDULER_CONTEXT', $context ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Admin/AdminDashboard.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Admin 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Admin; 12 | 13 | use Pronamic\WordPress\Pay\Plugin; 14 | 15 | /** 16 | * WordPress admin dashboard 17 | * 18 | * @author Remco Tolsma 19 | * @version 2.2.6 20 | * @since 3.7.0 21 | */ 22 | class AdminDashboard { 23 | /** 24 | * Construct admin dashboard. 25 | * 26 | * @link https://github.com/WordImpress/Give/blob/1.1/includes/admin/dashboard-widgets.php 27 | * @link https://github.com/woothemes/woocommerce/blob/2.3.13/includes/admin/class-wc-admin.php 28 | * @link https://github.com/woothemes/woocommerce/blob/2.3.13/includes/admin/class-wc-admin-dashboard.php 29 | */ 30 | public function __construct() { 31 | // Actions. 32 | add_action( 'wp_dashboard_setup', [ $this, 'setup' ] ); 33 | } 34 | 35 | /** 36 | * Setup. 37 | * 38 | * @link https://developer.wordpress.org/reference/functions/wp_add_dashboard_widget/ 39 | * @return void 40 | */ 41 | public function setup() { 42 | /** 43 | * Currently we only add dashboard widgets if the 44 | * current user can manage options. 45 | */ 46 | if ( ! current_user_can( 'manage_options' ) ) { 47 | return; 48 | } 49 | 50 | /** 51 | * The `wp_add_dashboard_widget` function should exist at 52 | * this point. To make tools like Psalm happy we do check 53 | * if the function exists. 54 | */ 55 | if ( ! function_exists( 'wp_add_dashboard_widget' ) ) { 56 | return; 57 | } 58 | 59 | /** 60 | * Ok, add the dashboard widget. 61 | */ 62 | wp_add_dashboard_widget( 63 | 'pronamic_pay_dashboard_status', 64 | __( 'Pronamic Pay Status', 'pronamic_ideal' ), 65 | [ $this, 'status_widget' ] 66 | ); 67 | } 68 | 69 | /** 70 | * Status widget. 71 | * 72 | * @return void 73 | */ 74 | public function status_widget() { 75 | include __DIR__ . '/../../views/widget-payments-status-list.php'; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/Admin/AdminNotification.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Admin 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Admin; 12 | 13 | use Pronamic\WordPress\Pay\Plugin; 14 | 15 | /** 16 | * WordPress admin notification. 17 | * 18 | * @author Remco Tolsma 19 | * @version 2.2.6 20 | * @since 3.7.0 21 | */ 22 | class AdminNotification { 23 | /** 24 | * ID. 25 | * 26 | * @var string 27 | */ 28 | private $id; 29 | 30 | /** 31 | * Name. 32 | * 33 | * @var string 34 | */ 35 | private $name; 36 | 37 | /** 38 | * Condition. 39 | * 40 | * @var bool 41 | */ 42 | private $condition; 43 | 44 | /** 45 | * Version. 46 | * 47 | * @var string 48 | */ 49 | private $version; 50 | 51 | /** 52 | * Constructs and initializes an notices object. 53 | * 54 | * @link https://github.com/woothemes/woocommerce/blob/2.4.3/includes/admin/class-wc-admin-notices.php 55 | * @param string $id ID. 56 | * @param string $name Name. 57 | * @param bool $condition Condition. 58 | * @param string $version Version. 59 | */ 60 | public function __construct( $id, $name, $condition, $version ) { 61 | $this->id = $id; 62 | $this->name = $name; 63 | $this->condition = $condition; 64 | $this->version = $version; 65 | } 66 | 67 | /** 68 | * Get ID. 69 | * 70 | * @return string 71 | */ 72 | public function get_id() { 73 | return $this->id; 74 | } 75 | 76 | /** 77 | * Get name. 78 | * 79 | * @return string 80 | */ 81 | public function get_name() { 82 | return $this->name; 83 | } 84 | 85 | /** 86 | * Is met. 87 | * 88 | * @return bool 89 | */ 90 | public function is_met() { 91 | return $this->condition; 92 | } 93 | 94 | /** 95 | * Get version. 96 | * 97 | * @return string 98 | */ 99 | public function get_version() { 100 | return $this->version; 101 | } 102 | 103 | /** 104 | * Get message. 105 | * 106 | * @return string 107 | */ 108 | public function get_message() { 109 | $message = \sprintf( 110 | 'We notice that the "%1$s" plugin is active, support for the "%1$s" plugin has been removed from the Pronamic Pay plugin since version %2$s.', 111 | $this->get_name(), 112 | $this->get_version() 113 | ); 114 | 115 | return $message; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /src/Banks/BankTransferDetails.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Banks; 12 | 13 | /** 14 | * Bank transfer details 15 | * 16 | * @author Reüel van der Steege 17 | * @since 2.2.6 18 | * @version 2.2.6 19 | */ 20 | class BankTransferDetails { 21 | /** 22 | * Bank account details. 23 | * 24 | * @var BankAccountDetails|null 25 | */ 26 | private $bank_account; 27 | 28 | /** 29 | * Reference. 30 | * 31 | * @var string|null 32 | */ 33 | private $reference; 34 | 35 | /** 36 | * Get bank account. 37 | * 38 | * @return BankAccountDetails|null 39 | */ 40 | public function get_bank_account() { 41 | return $this->bank_account; 42 | } 43 | 44 | /** 45 | * Set bank account. 46 | * 47 | * @param BankAccountDetails|null $bank_account Bank account. 48 | * @return void 49 | */ 50 | public function set_bank_account( $bank_account ) { 51 | $this->bank_account = $bank_account; 52 | } 53 | 54 | /** 55 | * Get reference. 56 | * 57 | * @return string|null 58 | */ 59 | public function get_reference() { 60 | return $this->reference; 61 | } 62 | 63 | /** 64 | * Set reference. 65 | * 66 | * @param string|null $reference Reference. 67 | * @return void 68 | */ 69 | public function set_reference( $reference ) { 70 | $this->reference = $reference; 71 | } 72 | 73 | /** 74 | * Get JSON. 75 | * 76 | * @return object|null 77 | */ 78 | public function get_json() { 79 | $data = []; 80 | 81 | // Bank account. 82 | $bank_account = $this->get_bank_account(); 83 | 84 | if ( null !== $bank_account ) { 85 | $data['bank_account'] = $bank_account->get_json(); 86 | } 87 | 88 | // Reference. 89 | $data['reference'] = $this->get_reference(); 90 | 91 | $data = array_filter( $data ); 92 | 93 | if ( empty( $data ) ) { 94 | return null; 95 | } 96 | 97 | return (object) $data; 98 | } 99 | 100 | /** 101 | * Create bank account details from object. 102 | * 103 | * @param mixed $json JSON. 104 | * @param BankTransferDetails|null $bank_transfer_details Bank account details. 105 | * 106 | * @return BankTransferDetails 107 | * 108 | * @throws \InvalidArgumentException Throws invalid argument exception when JSON is not an object. 109 | */ 110 | public static function from_json( $json, $bank_transfer_details = null ) { 111 | if ( ! is_object( $json ) ) { 112 | throw new \InvalidArgumentException( 'JSON value must be an object.' ); 113 | } 114 | 115 | if ( null === $bank_transfer_details ) { 116 | $bank_transfer_details = new self(); 117 | } 118 | 119 | if ( isset( $json->bank_account ) ) { 120 | $bank_transfer_details->set_bank_account( BankAccountDetails::from_json( $json->bank_account ) ); 121 | } 122 | 123 | if ( isset( $json->reference ) ) { 124 | $bank_transfer_details->set_reference( $json->reference ); 125 | } 126 | 127 | return $bank_transfer_details; 128 | } 129 | 130 | /** 131 | * Create an string representation of this object 132 | * 133 | * @return string 134 | */ 135 | public function __toString() { 136 | $pieces = [ 137 | $this->get_bank_account(), 138 | $this->get_reference(), 139 | ]; 140 | 141 | $pieces = array_map( 'strval', $pieces ); 142 | 143 | $pieces = array_map( 'trim', $pieces ); 144 | 145 | $pieces = array_filter( $pieces ); 146 | 147 | $string = implode( PHP_EOL, $pieces ); 148 | 149 | return $string; 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /src/Blocks/BlocksModule.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Blocks; 12 | 13 | use Pronamic\WordPress\Number\Number; 14 | use Pronamic\WordPress\Number\Parser as NumberParser; 15 | use Pronamic\WordPress\Money\Money; 16 | use Pronamic\WordPress\Pay\Forms\FormsSource; 17 | use Pronamic\WordPress\Pay\Payments\Payment; 18 | use Pronamic\WordPress\Pay\Plugin; 19 | use WP_Error; 20 | 21 | /** 22 | * Blocks 23 | * 24 | * @author Reüel van der Steege 25 | * @since 2.5.0 26 | * @version 2.1.7 27 | */ 28 | class BlocksModule { 29 | /** 30 | * Setup. 31 | * 32 | * @return void 33 | */ 34 | public function setup() { 35 | global $wp_version; 36 | 37 | add_filter( 'block_categories_all', [ $this, 'block_categories' ], 10 ); 38 | 39 | if ( \version_compare( $wp_version, '5.8', '<' ) ) { 40 | add_filter( 'block_categories', [ $this, 'block_categories' ], 10 ); 41 | } 42 | } 43 | 44 | /** 45 | * Block categories. 46 | * 47 | * @param array $categories Block categories. 48 | * @return array 49 | */ 50 | public function block_categories( $categories ) { 51 | $categories[] = [ 52 | 'slug' => 'pronamic-pay', 53 | 'title' => \__( 'Pronamic Pay', 'pronamic_ideal' ), 54 | 'icon' => null, 55 | ]; 56 | 57 | return $categories; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Core/GatewayConfig.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Core 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Core; 12 | 13 | /** 14 | * Title: Gateway config 15 | * Description: 16 | * Copyright: 2005-2024 Pronamic 17 | * Company: Pronamic 18 | * 19 | * @author Remco Tolsma 20 | * @version 2.0.8 21 | * @since 1.0.0 22 | */ 23 | abstract class GatewayConfig { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/Core/IdTrait.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Privacy 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Core; 12 | 13 | /** 14 | * Id Trait 15 | * 16 | * @author Remco Tolsma 17 | * @version 2.5.0 18 | * @since 2.5.0 19 | * @link https://github.com/search?q=%22trait+IdTrait%22+language%3APHP&type=Code 20 | */ 21 | trait IdTrait { 22 | /** 23 | * ID. 24 | * 25 | * @var string|null 26 | */ 27 | private $id; 28 | 29 | /** 30 | * Get the ID. 31 | * 32 | * @return int|null 33 | */ 34 | public function get_id() { 35 | return $this->id; 36 | } 37 | 38 | /** 39 | * Set the ID. 40 | * 41 | * @param int $id Unique ID. 42 | * @return void 43 | */ 44 | public function set_id( $id ) { 45 | $this->id = $id; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Core/ModeTrait.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Privacy 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Core; 12 | 13 | /** 14 | * Mode Trait 15 | * 16 | * @author Remco Tolsma 17 | * @version 2.5.0 18 | * @since 2.5.0 19 | * @link https://github.com/search?q=%22trait+VersionTrait%22+language%3APHP&type=Code 20 | */ 21 | trait ModeTrait { 22 | /** 23 | * Mode. 24 | * 25 | * @var string 26 | */ 27 | protected $mode = 'live'; 28 | 29 | /** 30 | * Set mode. 31 | * 32 | * @param string $mode Mode. 33 | * @return void 34 | * @throws \InvalidArgumentException Throws invalid argument exception when mode is not a string or not one of the mode constants. 35 | */ 36 | public function set_mode( $mode ) { 37 | if ( ! is_string( $mode ) ) { 38 | throw new \InvalidArgumentException( 'Mode must be a string.' ); 39 | } 40 | 41 | if ( ! in_array( $mode, [ Gateway::MODE_TEST, Gateway::MODE_LIVE ], true ) ) { 42 | throw new \InvalidArgumentException( 'Invalid mode.' ); 43 | } 44 | 45 | $this->mode = $mode; 46 | } 47 | 48 | /** 49 | * Get mode. 50 | * 51 | * @return string 52 | */ 53 | public function get_mode() { 54 | return $this->mode; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/Core/PaymentMethod.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Core 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Core; 12 | 13 | use Pronamic\WordPress\Pay\Fields\Field; 14 | 15 | /** 16 | * Payment method class 17 | */ 18 | class PaymentMethod { 19 | /** 20 | * ID. 21 | * 22 | * @var string 23 | */ 24 | private $id; 25 | 26 | /** 27 | * Name. 28 | * 29 | * @var string 30 | */ 31 | public $name; 32 | 33 | /** 34 | * Descriptions. 35 | * 36 | * @var array 37 | */ 38 | public $descriptions = []; 39 | 40 | /** 41 | * Status. 42 | * 43 | * @var string 44 | */ 45 | private $status; 46 | 47 | /** 48 | * Fields. 49 | * 50 | * @var Field[] 51 | */ 52 | private $fields = []; 53 | 54 | /** 55 | * Images. 56 | * 57 | * @var array 58 | */ 59 | public $images = []; 60 | 61 | /** 62 | * Supports. 63 | */ 64 | use SupportsTrait; 65 | 66 | /** 67 | * Construct payment method. 68 | * 69 | * @param string $id ID. 70 | */ 71 | public function __construct( $id ) { 72 | $this->id = $id; 73 | $this->name = (string) PaymentMethods::get_name( $id ); 74 | $this->status = ''; 75 | } 76 | 77 | /** 78 | * Get ID. 79 | * 80 | * @return string 81 | */ 82 | public function get_id() { 83 | return $this->id; 84 | } 85 | 86 | /** 87 | * Get name. 88 | * 89 | * @return string 90 | */ 91 | public function get_name() { 92 | return $this->name; 93 | } 94 | 95 | /** 96 | * Set name. 97 | * 98 | * @param string $name Name. 99 | * @return void 100 | */ 101 | public function set_name( $name ) { 102 | $this->name = $name; 103 | } 104 | 105 | /** 106 | * Get status. 107 | * 108 | * @return string 109 | */ 110 | public function get_status() { 111 | return $this->status; 112 | } 113 | 114 | /** 115 | * Set status. 116 | * 117 | * @param string $status Status. 118 | * @return void 119 | */ 120 | public function set_status( $status ) { 121 | $this->status = $status; 122 | } 123 | 124 | /** 125 | * Add field. 126 | * 127 | * @param Field $field Field. 128 | * @return void 129 | */ 130 | public function add_field( Field $field ) { 131 | $this->fields[] = $field; 132 | } 133 | 134 | /** 135 | * Get fields. 136 | * 137 | * @return Field[] 138 | */ 139 | public function get_fields() { 140 | return $this->fields; 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /src/Core/PaymentMethodsCollection.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Core 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Core; 12 | 13 | use ArrayIterator; 14 | use Countable; 15 | use IteratorAggregate; 16 | use Traversable; 17 | 18 | /** 19 | * Payment methods collection class 20 | * 21 | * @implements IteratorAggregate 22 | */ 23 | class PaymentMethodsCollection implements IteratorAggregate, Countable { 24 | /** 25 | * Items. 26 | * 27 | * @var PaymentMethod[] 28 | */ 29 | private $items = []; 30 | 31 | /** 32 | * Add payment method. 33 | * 34 | * @param PaymentMethod $payment_method Payment method. 35 | * @return void 36 | */ 37 | public function add( PaymentMethod $payment_method ) { 38 | $id = $payment_method->get_id(); 39 | 40 | $this->items[ $id ] = $payment_method; 41 | } 42 | 43 | /** 44 | * Get payment method by ID. 45 | * 46 | * @param string $id ID. 47 | * @return PaymentMethod|null 48 | */ 49 | public function get( $id ) { 50 | if ( array_key_exists( $id, $this->items ) ) { 51 | return $this->items[ $id ]; 52 | } 53 | 54 | return null; 55 | } 56 | 57 | /** 58 | * Query items. 59 | * 60 | * @param array $args Arguments. 61 | * @return self 62 | */ 63 | public function query( $args ) { 64 | $items = $this->items; 65 | 66 | if ( \array_key_exists( 'id', $args ) ) { 67 | $id_list = \wp_parse_list( $args['id'] ); 68 | 69 | $items = \array_filter( 70 | $items, 71 | function ( $payment_method ) use ( $id_list ) { 72 | return \in_array( $payment_method->get_id(), $id_list, true ); 73 | } 74 | ); 75 | } 76 | 77 | if ( \array_key_exists( 'status', $args ) ) { 78 | $status_list = \wp_parse_list( $args['status'] ); 79 | 80 | $items = \array_filter( 81 | $items, 82 | function ( $payment_method ) use ( $status_list ) { 83 | return \in_array( $payment_method->get_status(), $status_list, true ); 84 | } 85 | ); 86 | } 87 | 88 | if ( \array_key_exists( 'supports', $args ) ) { 89 | $feature = $args['supports']; 90 | 91 | $items = \array_filter( 92 | $items, 93 | function ( $payment_method ) use ( $feature ) { 94 | return $payment_method->supports( $feature ); 95 | } 96 | ); 97 | } 98 | 99 | $collection = new self(); 100 | 101 | $collection->items = $items; 102 | 103 | return $collection; 104 | } 105 | 106 | /** 107 | * Get iterator. 108 | * 109 | * @return ArrayIterator 110 | */ 111 | public function getIterator(): Traversable { 112 | return new ArrayIterator( $this->items ); 113 | } 114 | 115 | /** 116 | * Get array. 117 | * 118 | * @return array 119 | */ 120 | public function get_array() { 121 | return $this->items; 122 | } 123 | 124 | /** 125 | * Count items. 126 | * 127 | * @return int 128 | */ 129 | public function count(): int { 130 | return count( $this->items ); 131 | } 132 | 133 | /** 134 | * Is active. 135 | * 136 | * @param string $id Payment method ID. 137 | * @return bool True if status is active, false otherwise. 138 | */ 139 | public function is_active( $id ) { 140 | $payment_method = $this->get( $id ); 141 | 142 | if ( null === $payment_method ) { 143 | return false; 144 | } 145 | 146 | return ( 'active' === $payment_method->get_status() ); 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /src/Core/SupportsTrait.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Core 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Core; 12 | 13 | /** 14 | * Supports trait class 15 | */ 16 | trait SupportsTrait { 17 | /** 18 | * Supported features. 19 | * 20 | * @var array 21 | */ 22 | protected $supports = []; 23 | 24 | /** 25 | * Add support. 26 | * 27 | * @param string $feature Feature. 28 | * @return void 29 | */ 30 | public function add_support( $feature ) { 31 | $this->supports[] = $feature; 32 | } 33 | 34 | /** 35 | * Check if supports a given feature. 36 | * 37 | * @param string $feature The feature to check. 38 | * @return bool True if supported, false otherwise. 39 | */ 40 | public function supports( $feature ) { 41 | return in_array( $feature, $this->supports, true ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Core/TimestampsTrait.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Privacy 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Core; 12 | 13 | /** 14 | * Timestamps Trait 15 | * 16 | * @author Remco Tolsma 17 | * @version 2.5.0 18 | * @since 2.5.0 19 | * @link https://github.com/laravel/framework/blob/v7.27.0/src/Illuminate/Database/Eloquent/Concerns/HasTimestamps.php 20 | */ 21 | trait TimestampsTrait { 22 | /** 23 | * Created At. 24 | * 25 | * @var \DateTime|null 26 | */ 27 | private $created_at; 28 | 29 | /** 30 | * Updated At. 31 | * 32 | * @var \DateTime|null 33 | */ 34 | private $updated_at; 35 | 36 | /** 37 | * Set created at. 38 | * 39 | * @param \DateTime|null $created_at Created at. 40 | * @return void 41 | */ 42 | public function set_created_at( $created_at ) { 43 | $this->created_at = $created_at; 44 | } 45 | 46 | /** 47 | * Get created at. 48 | * 49 | * @return \DateTime|null 50 | */ 51 | public function get_created_at() { 52 | return $this->created_at; 53 | } 54 | 55 | /** 56 | * Set updated at. 57 | * 58 | * @param \DateTime|null $updated_at Updated at. 59 | * @return void 60 | */ 61 | public function set_updated_at( $updated_at ) { 62 | $this->updated_at = $updated_at; 63 | } 64 | 65 | /** 66 | * Get updated at. 67 | * 68 | * @return \DateTime|null 69 | */ 70 | public function get_updated_at() { 71 | return $this->updated_at; 72 | } 73 | 74 | /** 75 | * Touch. 76 | * 77 | * @return void 78 | */ 79 | public function touch() { 80 | if ( null === $this->created_at ) { 81 | $this->created_at = new \DateTime(); 82 | } 83 | 84 | $this->updated_at = new \DateTime(); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/Core/VersionTrait.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Privacy 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Core; 12 | 13 | /** 14 | * Version Trait 15 | * 16 | * @author Remco Tolsma 17 | * @version 2.5.0 18 | * @since 2.5.0 19 | * @link https://github.com/search?q=%22trait+VersionTrait%22+language%3APHP&type=Code 20 | */ 21 | trait VersionTrait { 22 | /** 23 | * Version. 24 | * 25 | * @var string|null 26 | */ 27 | private $version; 28 | 29 | /** 30 | * Set version. 31 | * 32 | * @param string|null $version Version. 33 | * @return void 34 | */ 35 | public function set_version( $version ) { 36 | $this->version = $version; 37 | } 38 | 39 | /** 40 | * Get version. 41 | * 42 | * @return string|null 43 | */ 44 | public function get_version() { 45 | return $this->version; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Core/XML/Util.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Core\XML 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Core\XML; 12 | 13 | use DOMDocument; 14 | use DOMNode; 15 | use DOMText; 16 | 17 | /** 18 | * Title: XML utility class 19 | * Description: 20 | * Copyright: 2005-2024 Pronamic 21 | * Company: Pronamic 22 | * 23 | * @author Remco Tolsma 24 | * @version 2.2.6 25 | * @since 1.2.1 26 | */ 27 | class Util { 28 | /** 29 | * Create and add an element with the specified name and value to the specified parent. 30 | * 31 | * @param DOMDocument $document DOM document to add the specified node to. 32 | * @param DOMNode $node DOM node to add a new element to. 33 | * @param string $name Name of the new DOM element to add. 34 | * @param string $value Value of the new DOM element to add. 35 | * 36 | * @return \DOMElement 37 | */ 38 | public static function add_element( DOMDocument $document, DOMNode $node, $name, $value = null ) { 39 | $element = $document->createElement( $name ); 40 | 41 | if ( null !== $value ) { 42 | $element->appendChild( new DOMText( $value ) ); 43 | } 44 | 45 | $node->appendChild( $element ); 46 | 47 | return $element; 48 | } 49 | 50 | /** 51 | * Add the specified elements to the parent node. 52 | * 53 | * @param DOMDocument $document DOM document to add the specified node to. 54 | * @param DOMNode $node DOM node to add a new element to. 55 | * @param array $elements The elements (name => value pairs) to add. 56 | * @return void 57 | */ 58 | public static function add_elements( DOMDocument $document, DOMNode $node, array $elements = [] ) { 59 | foreach ( $elements as $name => $value ) { 60 | $element = $document->createElement( $name ); 61 | 62 | if ( null !== $value ) { 63 | $element->appendChild( new DOMText( $value ) ); 64 | } 65 | 66 | $node->appendChild( $element ); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/Country.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay; 12 | 13 | use InvalidArgumentException; 14 | use stdClass; 15 | 16 | /** 17 | * Country 18 | * 19 | * @author Remco Tolsma 20 | * @version 2.2.6 21 | * @since 2.1.6 22 | */ 23 | class Country { 24 | /** 25 | * Code. 26 | * 27 | * @var string|null 28 | */ 29 | private $code; 30 | 31 | /** 32 | * Name. 33 | * 34 | * @var string|null 35 | */ 36 | private $name; 37 | 38 | /** 39 | * Get code. 40 | * 41 | * @return string|null 42 | */ 43 | public function get_code() { 44 | return $this->code; 45 | } 46 | 47 | /** 48 | * Set code. 49 | * 50 | * @throws InvalidArgumentException Thrown when country code length is not equal to 2. 51 | * 52 | * @param string|null $code Code. 53 | * @return void 54 | */ 55 | public function set_code( $code ) { 56 | if ( null !== $code && 2 !== strlen( $code ) ) { 57 | throw new InvalidArgumentException( 58 | \sprintf( 59 | 'Given country code `%s` not ISO 3166-1 alpha-2 value.', 60 | \esc_html( $code ) 61 | ) 62 | ); 63 | } 64 | 65 | $this->code = $code; 66 | } 67 | 68 | /** 69 | * Get name. 70 | * 71 | * @return string|null 72 | */ 73 | public function get_name() { 74 | return $this->name; 75 | } 76 | 77 | /** 78 | * Set name. 79 | * 80 | * @param string|null $name Name. 81 | * @return void 82 | */ 83 | public function set_name( $name ) { 84 | $this->name = $name; 85 | } 86 | 87 | /** 88 | * Get JSON. 89 | * 90 | * @return object|null 91 | */ 92 | public function get_json() { 93 | $data = [ 94 | 'code' => $this->code, 95 | 'name' => $this->name, 96 | ]; 97 | 98 | $data = array_filter( $data ); 99 | 100 | if ( empty( $data ) ) { 101 | return null; 102 | } 103 | 104 | return (object) $data; 105 | } 106 | 107 | /** 108 | * Create from object. 109 | * 110 | * @param mixed $json JSON. 111 | * @return Country 112 | * @throws InvalidArgumentException Throws invalid argument exception when JSON is not an object. 113 | */ 114 | public static function from_json( $json ) { 115 | if ( ! is_object( $json ) ) { 116 | throw new InvalidArgumentException( 'JSON value must be an object.' ); 117 | } 118 | 119 | $country = new self(); 120 | 121 | if ( isset( $json->code ) ) { 122 | $country->set_code( $json->code ); 123 | } 124 | 125 | if ( isset( $json->name ) ) { 126 | $country->set_name( $json->name ); 127 | } 128 | 129 | return $country; 130 | } 131 | 132 | /** 133 | * Create string representation of personal name. 134 | * 135 | * @return string 136 | */ 137 | public function __toString() { 138 | $values = [ 139 | $this->code, 140 | $this->name, 141 | ]; 142 | 143 | $values = array_filter( $values ); 144 | 145 | return implode( ' - ', $values ); 146 | } 147 | 148 | /** 149 | * Anonymize. 150 | * 151 | * @return void 152 | */ 153 | public function anonymize() { 154 | $this->set_code( PrivacyManager::anonymize_data( 'text', $this->get_code() ) ); 155 | $this->set_name( PrivacyManager::anonymize_data( 'text', $this->get_name() ) ); 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /src/CreditCard.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay; 12 | 13 | /** 14 | * Credit card class 15 | * 16 | * @author Remco Tolsma 17 | * @version 2.2.6 18 | * @since 1.4.0 19 | */ 20 | class CreditCard { 21 | /** 22 | * Credit card number. 23 | * 24 | * @var string|null 25 | */ 26 | private $number; 27 | 28 | /** 29 | * Credit card expiration month. 30 | * 31 | * @var int|null 32 | */ 33 | private $expiration_month; 34 | 35 | /** 36 | * Credit card expiration year. 37 | * 38 | * @var int|null 39 | */ 40 | private $expiration_year; 41 | 42 | /** 43 | * Credit card security code. 44 | * 45 | * @var string|null 46 | */ 47 | private $security_code; 48 | 49 | /** 50 | * Credit card holder name. 51 | * 52 | * @var string|null 53 | */ 54 | private $name; 55 | 56 | /** 57 | * Constructs and initializes a credit card object. 58 | */ 59 | public function __construct() { 60 | } 61 | 62 | /** 63 | * Get credit card number. 64 | * 65 | * @return string|null 66 | */ 67 | public function get_number() { 68 | return $this->number; 69 | } 70 | 71 | /** 72 | * Set credit card number. 73 | * 74 | * @param string|null $number Number. 75 | * @return void 76 | */ 77 | public function set_number( $number ) { 78 | $this->number = $number; 79 | } 80 | 81 | /** 82 | * Get expiration month. 83 | * 84 | * @return int|null 85 | */ 86 | public function get_expiration_month() { 87 | return $this->expiration_month; 88 | } 89 | 90 | /** 91 | * Set expiration month 92 | * 93 | * @param int|null $month Month. 94 | * @return void 95 | */ 96 | public function set_expiration_month( $month ) { 97 | $this->expiration_month = $month; 98 | } 99 | 100 | /** 101 | * Get expiration year. 102 | * 103 | * @return int|null 104 | */ 105 | public function get_expiration_year() { 106 | return $this->expiration_year; 107 | } 108 | 109 | /** 110 | * Set expiration year 111 | * 112 | * @param int|null $year Year. 113 | * @return void 114 | */ 115 | public function set_expiration_year( $year ) { 116 | $this->expiration_year = $year; 117 | } 118 | 119 | /** 120 | * Get expiration date. 121 | * 122 | * @link http://php.net/manual/en/datetime.formats.relative.php 123 | * @link http://php.net/manual/en/datetime.setdate.php 124 | * @return \DateTime|null 125 | */ 126 | public function get_expiration_date() { 127 | if ( empty( $this->expiration_year ) || empty( $this->expiration_month ) ) { 128 | return null; 129 | } 130 | 131 | $date = new \DateTime(); 132 | 133 | $date->setDate( $this->expiration_year, $this->expiration_month, 1 ); 134 | $date->setTime( 0, 0 ); 135 | 136 | return $date; 137 | } 138 | 139 | /** 140 | * Get security code. 141 | * 142 | * @return string|null 143 | */ 144 | public function get_security_code() { 145 | return $this->security_code; 146 | } 147 | 148 | /** 149 | * Set security code. 150 | * 151 | * @param string|null $security_code Security code. 152 | * @return void 153 | */ 154 | public function set_security_code( $security_code ) { 155 | $this->security_code = $security_code; 156 | } 157 | 158 | /** 159 | * Get credit card holder name. 160 | * 161 | * @return string|null 162 | */ 163 | public function get_name() { 164 | return $this->name; 165 | } 166 | 167 | /** 168 | * Set credit card holder name. 169 | * 170 | * @param string|null $name Name. 171 | * @return void 172 | */ 173 | public function set_name( $name ) { 174 | $this->name = $name; 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /src/Dependencies/Dependencies.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Dependencies 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Dependencies; 12 | 13 | /** 14 | * Dependencies 15 | * 16 | * @author Remco Tolsma 17 | * @version 2.2.6 18 | * @since 2.2.6 19 | */ 20 | class Dependencies { 21 | /** 22 | * Dependencies. 23 | * 24 | * @var array 25 | */ 26 | private $dependencies; 27 | 28 | /** 29 | * Construct. 30 | */ 31 | public function __construct() { 32 | $this->dependencies = []; 33 | } 34 | 35 | /** 36 | * Add dependency. 37 | * 38 | * @param Dependency $dependency The dependency to add. 39 | * @return void 40 | */ 41 | public function add( Dependency $dependency ) { 42 | $this->dependencies[] = $dependency; 43 | } 44 | 45 | /** 46 | * Are met. 47 | * 48 | * @return bool True if dependencies are met, false otherwise. 49 | */ 50 | public function are_met() { 51 | foreach ( $this->dependencies as $dependency ) { 52 | if ( ! $dependency->is_met() ) { 53 | return false; 54 | } 55 | } 56 | 57 | return true; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Dependencies/Dependency.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Dependencies 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Dependencies; 12 | 13 | /** 14 | * Dependency 15 | * 16 | * @author Remco Tolsma 17 | * @version 2.2.6 18 | * @since 2.2.6 19 | */ 20 | abstract class Dependency { 21 | /** 22 | * Is met. 23 | * 24 | * @return bool True if dependency is met, false otherwise. 25 | */ 26 | abstract public function is_met(); 27 | } 28 | -------------------------------------------------------------------------------- /src/Dependencies/PhpDependency.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Dependencies 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Dependencies; 12 | 13 | /** 14 | * PHP Dependency 15 | * 16 | * @link https://github.com/Yoast/yoast-acf-analysis/blob/2.3.0/inc/dependencies/dependency-yoast-seo.php 17 | * @link https://github.com/dsawardekar/wp-requirements/blob/0.3.0/lib/Requirements.php#L104-L118 18 | * @author Remco Tolsma 19 | * @version 2.2.6 20 | * @since 2.2.6 21 | */ 22 | class PhpDependency extends Dependency { 23 | /** 24 | * Minimum PHP version. 25 | * 26 | * @var string 27 | */ 28 | private $minimum_version; 29 | 30 | /** 31 | * Construct PHP dependency. 32 | * 33 | * @param string $minimum_version Minimum PHP version. 34 | */ 35 | public function __construct( $minimum_version ) { 36 | $this->minimum_version = $minimum_version; 37 | } 38 | 39 | /** 40 | * Is met. 41 | * 42 | * @link https://github.com/dsawardekar/wp-requirements/blob/0.3.0/lib/Requirements.php#L104-L118 43 | * @return bool True if dependency is met, false otherwise. 44 | */ 45 | public function is_met() { 46 | return \version_compare( 47 | \strval( \phpversion() ), 48 | $this->minimum_version, 49 | '>=' 50 | ); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Dependencies/PhpExtensionDependency.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Dependencies 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Dependencies; 12 | 13 | /** 14 | * PHP Extension Dependency 15 | * 16 | * @link https://github.com/Yoast/yoast-acf-analysis/blob/2.3.0/inc/dependencies/dependency-yoast-seo.php 17 | * @link https://github.com/dsawardekar/wp-requirements/blob/0.3.0/lib/Requirements.php#L104-L118 18 | * @author Remco Tolsma 19 | * @version 2.2.6 20 | * @since 2.2.6 21 | */ 22 | class PhpExtensionDependency extends Dependency { 23 | /** 24 | * Required PHP extension. 25 | * 26 | * @var string 27 | */ 28 | private $required_extension; 29 | 30 | /** 31 | * Construct PHP extension dependency. 32 | * 33 | * @param string $required_extension Required PHP extension. 34 | */ 35 | public function __construct( $required_extension ) { 36 | $this->required_extension = $required_extension; 37 | } 38 | 39 | /** 40 | * Is met. 41 | * 42 | * @return bool True if dependency is met, false otherwise. 43 | */ 44 | public function is_met() { 45 | return \extension_loaded( $this->required_extension ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Dependencies/WordPressDependency.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Dependencies 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Dependencies; 12 | 13 | /** 14 | * WordPress Dependency 15 | * 16 | * @link https://github.com/Yoast/yoast-acf-analysis/blob/2.3.0/inc/dependencies/dependency-yoast-seo.php 17 | * @link https://github.com/dsawardekar/wp-requirements/blob/0.3.0/lib/Requirements.php#L104-L118 18 | * @author Remco Tolsma 19 | * @version 2.2.6 20 | * @since 2.2.6 21 | */ 22 | class WordPressDependency extends Dependency { 23 | /** 24 | * Minimum WordPress version. 25 | * 26 | * @var string 27 | */ 28 | private $minimum_version; 29 | 30 | /** 31 | * Construct WordPress dependency. 32 | * 33 | * @param string $minimum_version Minimum WordPress version. 34 | */ 35 | public function __construct( $minimum_version ) { 36 | $this->minimum_version = $minimum_version; 37 | } 38 | 39 | /** 40 | * Is met. 41 | * 42 | * @link https://codex.wordpress.org/Global_Variables 43 | * @return bool True if dependency is met, false otherwise. 44 | */ 45 | public function is_met() { 46 | global $wp_version; 47 | 48 | return \version_compare( 49 | $wp_version, 50 | $this->minimum_version, 51 | '>=' 52 | ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Fields/CachedCallbackOptions.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Core 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Fields; 12 | 13 | use ArrayIterator; 14 | use IteratorAggregate; 15 | use Traversable; 16 | 17 | /** 18 | * Cached callback options class 19 | * 20 | * @phpstan-implements IteratorAggregate 21 | */ 22 | class CachedCallbackOptions implements IteratorAggregate { 23 | /** 24 | * Cache key. 25 | * 26 | * @var string 27 | */ 28 | private $cache_key; 29 | 30 | /** 31 | * Callback. 32 | * 33 | * @var callable: array 34 | */ 35 | private $callback; 36 | 37 | /** 38 | * Construct cached callback options. 39 | * 40 | * @param callable $callback Callback. 41 | * @param string $cache_key Cache key. 42 | */ 43 | public function __construct( $callback, $cache_key ) { 44 | $this->callback = $callback; 45 | $this->cache_key = $cache_key; 46 | } 47 | 48 | /** 49 | * Get iterator. 50 | * 51 | * @return ArrayIterator 52 | */ 53 | public function getIterator(): Traversable { 54 | $options = $this->get_transient_options(); 55 | 56 | return new ArrayIterator( $options ); 57 | } 58 | 59 | /** 60 | * Get callback options. 61 | * 62 | * @return array 63 | */ 64 | private function get_callback_options() { 65 | return \call_user_func( $this->callback ); 66 | } 67 | 68 | /** 69 | * Get transient options. 70 | * 71 | * @return array 72 | */ 73 | private function get_transient_options() { 74 | if ( '' === $this->cache_key ) { 75 | return $this->get_callback_options(); 76 | } 77 | 78 | $options = \get_transient( $this->cache_key ); 79 | 80 | if ( false === $options ) { 81 | $options = $this->get_callback_options(); 82 | 83 | \set_transient( $this->cache_key, $options, \DAY_IN_SECONDS ); 84 | } 85 | 86 | return $options; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/Fields/DateField.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Core 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Fields; 12 | 13 | use Pronamic\WordPress\Html\Element; 14 | 15 | /** 16 | * Date field class 17 | */ 18 | class DateField extends Field { 19 | /** 20 | * Get element. 21 | * 22 | * @return Element|null 23 | */ 24 | protected function get_element() { 25 | $element = new Element( 26 | 'input', 27 | [ 28 | 'type' => 'date', 29 | 'id' => $this->get_id(), 30 | 'name' => $this->get_id(), 31 | ] 32 | ); 33 | 34 | return $element; 35 | } 36 | 37 | /** 38 | * Serialize to JSON. 39 | * 40 | * @return mixed 41 | */ 42 | #[\ReturnTypeWillChange] 43 | public function jsonSerialize() { 44 | $data = parent::jsonSerialize(); 45 | 46 | $data['type'] = 'date'; 47 | 48 | return $data; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Fields/Field.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Core 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Fields; 12 | 13 | use JsonSerializable; 14 | use Pronamic\WordPress\Html\Element; 15 | 16 | /** 17 | * Field class 18 | */ 19 | class Field implements JsonSerializable { 20 | /** 21 | * ID. 22 | * 23 | * @var string 24 | */ 25 | private $id; 26 | 27 | /** 28 | * Label. 29 | * 30 | * @var string 31 | */ 32 | private $label = ''; 33 | 34 | /** 35 | * Required. 36 | * 37 | * @var bool 38 | */ 39 | private $required = false; 40 | 41 | /** 42 | * Meta key. 43 | * 44 | * @var string 45 | */ 46 | public $meta_key = ''; 47 | 48 | /** 49 | * Construct field. 50 | * 51 | * @param string $id ID. 52 | */ 53 | public function __construct( $id ) { 54 | $this->id = $id; 55 | 56 | $this->setup(); 57 | } 58 | 59 | /** 60 | * Setup field. 61 | * 62 | * @return void 63 | */ 64 | protected function setup() { 65 | } 66 | 67 | /** 68 | * Get ID. 69 | * 70 | * @return string 71 | */ 72 | public function get_id() { 73 | return $this->id; 74 | } 75 | 76 | /** 77 | * Get label. 78 | * 79 | * @return string 80 | */ 81 | public function get_label(): string { 82 | return $this->label; 83 | } 84 | 85 | /** 86 | * Set label. 87 | * 88 | * @param string $label Label. 89 | */ 90 | public function set_label( string $label ): void { 91 | $this->label = $label; 92 | } 93 | 94 | /** 95 | * Set required. 96 | * 97 | * @param bool $required Required. 98 | */ 99 | public function set_required( bool $required ): void { 100 | $this->required = $required; 101 | } 102 | 103 | /** 104 | * Is required. 105 | * 106 | * @return bool 107 | */ 108 | public function is_required(): bool { 109 | return $this->required; 110 | } 111 | 112 | /** 113 | * Get element. 114 | * 115 | * @return Element|null 116 | */ 117 | protected function get_element() { 118 | return null; 119 | } 120 | 121 | /** 122 | * Render. 123 | * 124 | * @return string 125 | */ 126 | public function render() { 127 | $element = $this->get_element(); 128 | 129 | if ( null === $element ) { 130 | return ''; 131 | } 132 | 133 | return $element->render(); 134 | } 135 | 136 | /** 137 | * Output. 138 | * 139 | * @return void 140 | */ 141 | public function output() { 142 | $element = $this->get_element(); 143 | 144 | if ( null === $element ) { 145 | return; 146 | } 147 | 148 | $element->output(); 149 | } 150 | 151 | /** 152 | * Serialize to JSON. 153 | * 154 | * @return mixed 155 | */ 156 | #[\ReturnTypeWillChange] 157 | public function jsonSerialize() { 158 | return [ 159 | 'type' => '', 160 | 'id' => $this->id, 161 | 'label' => $this->label, 162 | 'required' => $this->required, 163 | ]; 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /src/Fields/IDealIssuerSelectField.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay\Core 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay\Fields; 12 | 13 | /** 14 | * Select field iDEAL issuer class 15 | */ 16 | class IDealIssuerSelectField extends SelectField { 17 | /** 18 | * Setup. 19 | * 20 | * @return void 21 | */ 22 | protected function setup() { 23 | parent::setup(); 24 | 25 | $this->meta_key = 'issuer'; 26 | 27 | $this->set_label( \__( 'Bank', 'pronamic_ideal' ) ); 28 | } 29 | 30 | /** 31 | * Get options. 32 | * 33 | * @return array 34 | */ 35 | public function get_options() { 36 | $options = parent::get_options(); 37 | 38 | return [ 39 | /** 40 | * The list should be accompanied by the instruction phrase "Kies uw bank" (UK: "Choose your bank"). In 41 | * case of an HTML ', 39 | esc_attr( $name ), 40 | esc_attr( $value ) 41 | ); 42 | } 43 | 44 | ?> 45 | 46 | 47 | 48 | 49 | 'text/javascript', 62 | ] 63 | ); 64 | 65 | $element->children[] = 'document.pronamic_ideal_form.submit();'; 66 | 67 | $element->output(); 68 | } 69 | -------------------------------------------------------------------------------- /views/meta-box-gateway-payment-methods.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | * @var array $columns Columns. 10 | * @var array $payment_methods Payment methods. 11 | * @var bool $supports_methods_request Supports methods request. 12 | */ 13 | 14 | use Pronamic\WordPress\Pay\Core\PaymentMethods; 15 | 16 | if ( ! defined( 'ABSPATH' ) ) { 17 | exit; 18 | } 19 | 20 | $show_recurring_column = false; 21 | 22 | foreach ( $payment_methods as $payment_method ) { 23 | if ( $payment_method->supports( 'recurring' ) ) { 24 | $show_recurring_column = true; 25 | 26 | break; 27 | } 28 | } 29 | 30 | ?> 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 53 | 71 | 72 | 73 | 74 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 |
51 | get_name() ); ?> 52 | 54 | get_status() ) { 59 | case 'active': 60 | $icon = 'completed'; 61 | break; 62 | case 'inactive': 63 | $icon = 'cancelled'; 64 | break; 65 | } 66 | 67 | printf( '', esc_attr( $icon ) ); 68 | 69 | ?> 70 | 75 | supports( 'recurring' ) ) { 80 | $icon = 'completed'; 81 | } 82 | 83 | printf( '', esc_attr( $icon ) ); 84 | 85 | ?> 86 |
96 | -------------------------------------------------------------------------------- /views/meta-box-gateway-webhook-log.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | * @var string $gateway_id Gateway ID. 10 | * @var int $config_id Configuration ID. 11 | * @var \Pronamic\WordPress\Pay\Core\Gateway $gateway Gateway. 12 | */ 13 | 14 | use Pronamic\WordPress\Pay\Plugin; 15 | use Pronamic\WordPress\Pay\Webhooks\WebhookRequestInfo; 16 | 17 | if ( ! defined( 'ABSPATH' ) ) { 18 | exit; 19 | } 20 | 21 | $integration = pronamic_pay_plugin()->gateway_integrations->get_integration( $gateway_id ); 22 | 23 | if ( ! $integration || ! $integration->supports( 'webhook_log' ) ) { 24 | esc_html_e( 'This gateway does not support webhook logging.', 'pronamic_ideal' ); 25 | 26 | return; 27 | } 28 | 29 | $webhook_log_json_string = get_post_meta( $config_id, '_pronamic_gateway_webhook_log', true ); 30 | 31 | $config_gateway_id = get_post_meta( $config_id, '_pronamic_gateway_id', true ); 32 | 33 | if ( empty( $webhook_log_json_string ) || $config_gateway_id !== $gateway_id ) { 34 | esc_html_e( 'No webhook request processed yet.', 'pronamic_ideal' ); 35 | 36 | return; 37 | } 38 | 39 | $object = json_decode( $webhook_log_json_string ); 40 | 41 | try { 42 | $webhook_log_request_info = WebhookRequestInfo::from_json( $object ); 43 | } catch ( InvalidArgumentException $e ) { 44 | printf( 45 | /* translators: %s: Exception message. */ 46 | esc_html__( 'The following error occurred when reading the webhook request information: "%s".', 'pronamic_ideal' ), 47 | esc_html( $e->getMessage() ) 48 | ); 49 | 50 | return; 51 | } 52 | 53 | $payment = $webhook_log_request_info->get_payment(); 54 | 55 | $payment_id = ( null === $payment ) ? null : $payment->get_id(); 56 | 57 | if ( null !== $payment_id ) { 58 | echo wp_kses( 59 | sprintf( 60 | /* translators: 1: formatted date, 2: payment edit url, 3: payment id */ 61 | __( 62 | 'Last webhook request processed on %1$s for payment #%3$s.', 63 | 'pronamic_ideal' 64 | ), 65 | $webhook_log_request_info->get_request_date()->format_i18n( _x( 'l j F Y \a\t H:i', 'full datetime format', 'pronamic_ideal' ) ), 66 | esc_url( (string) get_edit_post_link( $payment_id ) ), 67 | (string) $payment_id 68 | ), 69 | [ 70 | 'a' => [ 71 | 'href' => true, 72 | 'title' => true, 73 | ], 74 | ] 75 | ); 76 | } else { 77 | echo esc_html( 78 | sprintf( 79 | /* translators: %s: formatted date */ 80 | __( 81 | 'Last webhook request processed on %s.', 82 | 'pronamic_ideal' 83 | ), 84 | $webhook_log_request_info->get_request_date()->format_i18n( _x( 'l j F Y \a\t H:i', 'full datetime format', 'pronamic_ideal' ) ) 85 | ) 86 | ); 87 | } 88 | -------------------------------------------------------------------------------- /views/meta-box-notes.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay; 12 | 13 | use Pronamic\WordPress\DateTime\DateTime; 14 | use Pronamic\WordPress\DateTime\DateTimeZone; 15 | 16 | if ( ! defined( 'ABSPATH' ) ) { 17 | exit; 18 | } 19 | 20 | if ( ! isset( $notes ) ) { 21 | return; 22 | } 23 | 24 | if ( ! is_array( $notes ) ) { 25 | return; 26 | } 27 | 28 | if ( empty( $notes ) ) : ?> 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 57 | 60 | 63 | 64 | 65 | 66 | 67 | 68 |
49 | comment_date_gmt, new DateTimeZone( 'UTC' ) ); 52 | 53 | echo esc_html( $date->format_i18n() ); 54 | 55 | ?> 56 | 58 | 59 | 61 | 62 |
69 | 70 | 71 | -------------------------------------------------------------------------------- /views/meta-box-payment-refunds.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | namespace Pronamic\WordPress\Pay; 12 | 13 | if ( ! defined( 'ABSPATH' ) ) { 14 | exit; 15 | } 16 | 17 | if ( empty( $payment->refunds ) ) : ?> 18 | 19 |

20 | 21 |

22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | refunds as $refund ) : ?> 50 | 51 | 52 | 53 | 54 | 55 | 56 | 69 | 70 | 71 | 72 | 73 | 74 |
created_at->format_i18n() ); ?>get_amount()->format_i18n() ); ?>psp_id ); ?>get_description() ); ?> 57 | created_by->ID > 0 ) { 62 | $name = $refund->created_by->display_name; 63 | } 64 | 65 | echo \esc_html( $name ); 66 | 67 | ?> 68 |
75 |
76 | 77 | 78 | -------------------------------------------------------------------------------- /views/meta-box-payment-subscription.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | * @var \Pronamic\WordPress\Pay\Payments\Payment $payment Payment. 10 | */ 11 | 12 | use Pronamic\WordPress\Pay\Util; 13 | 14 | if ( ! defined( 'ABSPATH' ) ) { 15 | exit; 16 | } 17 | 18 | $subscriptions = $payment->get_subscriptions(); 19 | 20 | if ( empty( $subscriptions ) ) : ?> 21 | 22 |

23 | 24 |

25 | 26 | 27 | 28 | 29 | 30 | get_id(); 33 | 34 | $phase = $subscription->get_display_phase(); 35 | 36 | ?> 37 | 38 | 39 | 40 | 41 | 42 | 43 | 46 | 49 | 50 | 51 | 54 | 67 | 68 | 69 | 70 | 71 | 72 | 75 | 78 | 79 | 80 | 83 | 92 | 93 | 94 | 97 | 119 | 120 | 121 | 124 | 139 | 140 |
44 | 45 | 47 | 48 |
52 | 53 | 55 | label ) ) { 60 | echo esc_html( $status_object->label ); 61 | } else { 62 | echo '—'; 63 | } 64 | 65 | ?> 66 |
73 | 74 | 76 | get_description() ); ?> 77 |
81 | 82 | 84 | get_amount()->format_i18n() ); 88 | } 89 | 90 | ?> 91 |
95 | 96 | 98 | get_total_periods(); 101 | 102 | if ( null === $phase || 1 === $total_periods ) { 103 | // No recurrence. 104 | echo '—'; 105 | } elseif ( null === $total_periods ) { 106 | // Infinite. 107 | echo esc_html( strval( Util::format_recurrences( $phase->get_interval() ) ) ); 108 | } else { 109 | // Fixed number of recurrences. 110 | printf( 111 | '%s (%s)', 112 | esc_html( strval( Util::format_recurrences( $phase->get_interval() ) ) ), 113 | esc_html( strval( Util::format_frequency( $total_periods ) ) ) 114 | ); 115 | } 116 | 117 | ?> 118 |
122 | 123 | 125 | get_source_text(), 129 | [ 130 | 'a' => [ 131 | 'href' => true, 132 | ], 133 | 'br' => [], 134 | ] 135 | ); 136 | 137 | ?> 138 |
141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /views/notice-license.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | if ( ! defined( 'ABSPATH' ) ) { 12 | exit; 13 | } 14 | 15 | if ( ! isset( $data ) ) { 16 | return; 17 | } 18 | 19 | $class = ( 'valid' === $data->license ) ? 'updated' : 'error'; 20 | 21 | ?> 22 |
23 |

24 | — 25 | license ) { 28 | echo \esc_html( 29 | \sprintf( 30 | /* translators: %s: Pronamic Pay */ 31 | \__( 'Thank you for activating your license and using the %s plugin.', 'pronamic_ideal' ), 32 | \__( 'Pronamic Pay', 'pronamic_ideal' ) 33 | ) 34 | ); 35 | } elseif ( 'invalid' === $data->license && \property_exists( $data, 'activations_left' ) && 0 === $data->activations_left ) { 36 | echo \wp_kses( 37 | __( 'This license does not have any activations left. Maybe you have to deactivate your license on a local/staging server. This can be done on your Pronamic.shop account.', 'pronamic_ideal' ), 38 | [ 39 | 'a' => [ 40 | 'href' => true, 41 | 'target' => true, 42 | ], 43 | ] 44 | ); 45 | } else { 46 | \esc_html_e( 'There was a problem activating your license key, please try again or contact support.', 'pronamic_ideal' ); 47 | } 48 | 49 | ?> 50 |

51 |
52 | -------------------------------------------------------------------------------- /views/page-settings.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | if ( ! defined( 'ABSPATH' ) ) { 12 | exit; 13 | } 14 | 15 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended 16 | $message_id = array_key_exists( 'message', $_GET ) ? \sanitize_text_field( \wp_unslash( $_GET['message'] ) ) : ''; 17 | 18 | if ( ! empty( $message_id ) ) { 19 | switch ( $message_id ) { 20 | case 'pages-generated': 21 | printf( 22 | '

%s

', 23 | esc_html__( 'The default payment status pages are created.', 'pronamic_ideal' ) 24 | ); 25 | 26 | break; 27 | case 'pages-not-generated': 28 | printf( 29 | '

%s

', 30 | esc_html__( 'The default payment status pages could not be created.', 'pronamic_ideal' ) 31 | ); 32 | 33 | break; 34 | } 35 | } 36 | 37 | ?> 38 | 39 |
40 |

41 | 42 |
43 | 44 |
45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 |
53 |
54 | -------------------------------------------------------------------------------- /views/pointer-dashboard.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | if ( ! defined( 'ABSPATH' ) ) { 12 | exit; 13 | } 14 | 15 | ?> 16 |

17 | 18 |

19 | 20 | 21 | 22 |

23 | -------------------------------------------------------------------------------- /views/pointer-forms.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | if ( ! defined( 'ABSPATH' ) ) { 12 | exit; 13 | } 14 | 15 | ?> 16 |

17 | 18 |

19 | 20 | 21 | “Gravity Forms” plugin.', 'pronamic_ideal' ), 27 | esc_attr( 'https://www.pronamic.nl/go/gravity-forms/' ), 28 | esc_attr( '_blank' ) 29 | ), 30 | [ 31 | 'a' => [ 32 | 'href' => true, 33 | 'target' => true, 34 | ], 35 | ] 36 | ); 37 | 38 | ?> 39 |

40 | -------------------------------------------------------------------------------- /views/pointer-gateways.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | if ( ! defined( 'ABSPATH' ) ) { 12 | exit; 13 | } 14 | 15 | ?> 16 |

17 | 18 |

19 | 20 | 21 | 22 |

23 | -------------------------------------------------------------------------------- /views/pointer-payments.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | if ( ! defined( 'ABSPATH' ) ) { 12 | exit; 13 | } 14 | 15 | ?> 16 |

17 | 18 |

19 | 20 | 21 | 22 |

23 | -------------------------------------------------------------------------------- /views/pointer-reports.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | if ( ! defined( 'ABSPATH' ) ) { 12 | exit; 13 | } 14 | 15 | ?> 16 |

17 | 18 |

19 | 20 | 21 |

22 | -------------------------------------------------------------------------------- /views/pointer-settings.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | if ( ! defined( 'ABSPATH' ) ) { 12 | exit; 13 | } 14 | 15 | ?> 16 |

17 | 18 |

19 | 20 | 21 |

22 | -------------------------------------------------------------------------------- /views/pointer-start.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | if ( ! defined( 'ABSPATH' ) ) { 12 | exit; 13 | } 14 | 15 | ?> 16 |

17 | 18 |

19 | 20 |

21 | -------------------------------------------------------------------------------- /views/redirect-via-html.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | * @var \Pronamic\WordPress\Pay\Payments\Payment $payment Payment. 10 | * @var \Pronamic\WordPress\Pay\Core\Gateway $this Gateway. 11 | */ 12 | 13 | use Pronamic\WordPress\Html\Element; 14 | 15 | if ( ! defined( 'ABSPATH' ) ) { 16 | exit; 17 | } 18 | 19 | ?> 20 | 21 | 22 | > 23 | 24 | 25 | 26 | 27 | 28 | <?php esc_html_e( 'Redirecting…', 'pronamic_ideal' ); ?> 29 | 30 | 31 | 32 | 'text/javascript', 44 | ] 45 | ); 46 | 47 | $element->children[] = 'if ( window.top.location !== window.location ) { window.top.location = window.location; }'; 48 | 49 | $element->output(); 50 | 51 | ?> 52 | 53 | 54 | 55 | 56 |
57 |
58 |

59 | 60 |

61 | 62 |

63 | 64 |
65 |
66 |

67 | 68 |

69 | 70 | output_form( $payment ); ?> 71 |
72 |
73 | 74 |
75 |
76 |

77 | 78 |
79 |
80 |
get_date()->format_i18n() ); ?>
81 | 82 | get_transaction_id(); ?> 83 | 84 | 85 | 86 |
87 |
88 | 89 | 90 | 91 |
92 |
get_description() ); ?>
93 | 94 |
95 |
get_total_amount()->format_i18n() ); ?>
96 |
97 |
98 |
99 |
100 |
101 | 102 | 103 | -------------------------------------------------------------------------------- /views/subscription-cancel.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | use Pronamic\WordPress\Pay\Subscriptions\SubscriptionStatus; 12 | 13 | if ( ! defined( 'ABSPATH' ) ) { 14 | exit; 15 | } 16 | 17 | if ( ! isset( $subscription ) ) { 18 | return; 19 | } 20 | 21 | $phase = $subscription->get_current_phase(); 22 | 23 | ?> 24 | 25 | 26 | > 27 | 28 | 29 | 30 | 31 | 32 | <?php esc_html_e( 'Subscription Cancellation', 'pronamic_ideal' ); ?> 33 | 34 | 35 | 36 | 37 | 38 |
39 |
40 |

41 | 42 |
43 |
44 | 45 | 51 | 52 | get_status() ) : ?> 53 | 54 |

55 | 56 |

57 | 58 | 59 |
60 | 61 | get_status() ) : ?> 62 | 63 |
64 | 65 |

66 | 67 |

68 | 69 |
70 | get_id(), 'pronamic_pay_cancel_subscription_nonce' ); ?> 71 | 72 | 73 |
74 | 75 |
76 | 77 | 78 |
79 |
80 |
81 | 82 | 83 | -------------------------------------------------------------------------------- /views/subscription-details.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | use Pronamic\WordPress\Pay\Core\PaymentMethods; 12 | use Pronamic\WordPress\Pay\Util; 13 | 14 | if ( ! defined( 'ABSPATH' ) ) { 15 | exit; 16 | } 17 | 18 | if ( ! isset( $subscription ) ) { 19 | return; 20 | } 21 | 22 | /* 23 | * Subscription details. 24 | */ 25 | $details = [ 26 | [ 27 | 'term' => __( 'Description', 'pronamic_ideal' ), 28 | 'description' => $subscription->get_description(), 29 | ], 30 | ]; 31 | 32 | // Current phase. 33 | $phase = $subscription->get_current_phase(); 34 | 35 | $recurrence = '—'; 36 | 37 | if ( null !== $phase ) { 38 | // Amount. 39 | $details[] = [ 40 | 'term' => __( 'Amount', 'pronamic_ideal' ), 41 | 'description' => $phase->get_amount()->format_i18n(), 42 | ]; 43 | 44 | // Recurrence. 45 | if ( $phase->is_infinite() ) : 46 | // Infinite. 47 | $recurrence = Util::format_recurrences( $phase->get_interval() ); 48 | 49 | elseif ( 1 !== $phase->get_total_periods() ) : 50 | // Fixed number of recurrences. 51 | $recurrence = sprintf( 52 | '%s (%s)', 53 | Util::format_recurrences( $phase->get_interval() ), 54 | Util::format_frequency( $phase->get_total_periods() ) 55 | ); 56 | 57 | endif; 58 | } 59 | 60 | // Payment method. 61 | $payment_method = $subscription->get_payment_method(); 62 | 63 | if ( ! empty( $payment_method ) ) { 64 | $details[] = [ 65 | 'term' => __( 'Payment method', 'pronamic_ideal' ), 66 | 'description' => PaymentMethods::get_name( $payment_method ), 67 | ]; 68 | } 69 | 70 | // Recurrence. 71 | $details[] = [ 72 | 'term' => __( 'Recurrence', 'pronamic_ideal' ), 73 | 'description' => $recurrence, 74 | ]; 75 | 76 | ?> 77 | 78 |

79 | 80 |
81 | 82 | 83 | 84 | 85 |
86 | 87 | 88 | 89 | 90 | 91 |
92 | 93 | 94 | 95 | 96 |
97 | -------------------------------------------------------------------------------- /views/subscription-mandate-failed.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | if ( ! defined( 'ABSPATH' ) ) { 12 | exit; 13 | } 14 | 15 | ?> 16 | 17 | 18 | > 19 | 20 | 21 | 22 | 23 | 24 | <?php esc_html_e( 'Subscription Mandate', 'pronamic_ideal' ); ?> 25 | 26 | 27 | 28 | 29 | 30 |
31 |
32 |

33 | 34 |

35 |
36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /views/subscription-mandate-updated.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | if ( ! defined( 'ABSPATH' ) ) { 12 | exit; 13 | } 14 | 15 | ?> 16 | 17 | 18 | > 19 | 20 | 21 | 22 | 23 | 24 | <?php esc_html_e( 'Subscription Mandate', 'pronamic_ideal' ); ?> 25 | 26 | 27 | 28 | 29 | 30 |
31 |
32 |

33 | 34 |

35 | 36 |

37 | 38 | 39 | 40 |

41 |
42 |
43 | 44 | 45 | -------------------------------------------------------------------------------- /views/subscription-renew-failed.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | if ( ! defined( 'ABSPATH' ) ) { 12 | exit; 13 | } 14 | 15 | ?> 16 | 17 | 18 | > 19 | 20 | 21 | 22 | 23 | 24 | <?php esc_html_e( 'Subscription Renewal', 'pronamic_ideal' ); ?> 25 | 26 | 27 | 28 | 29 | 30 |
31 |
32 |

33 | 34 |
35 |
36 |

37 | 38 |

39 |
40 |
41 |
42 |
43 | 44 | 45 | -------------------------------------------------------------------------------- /views/subscription-renew.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | use Pronamic\WordPress\DateTime\DateTimeImmutable; 12 | use Pronamic\WordPress\Pay\Subscriptions\SubscriptionPhase; 13 | use Pronamic\WordPress\Pay\Subscriptions\SubscriptionStatus; 14 | 15 | if ( ! defined( 'ABSPATH' ) ) { 16 | exit; 17 | } 18 | 19 | if ( ! isset( $subscription, $gateway ) ) { 20 | return; 21 | } 22 | 23 | $phase = $subscription->get_current_phase(); 24 | 25 | ?> 26 | 27 | 28 | > 29 | 30 | 31 | 32 | 33 | 34 | <?php esc_html_e( 'Subscription Renewal', 'pronamic_ideal' ); ?> 35 | 36 | 37 | 38 | 39 | 40 |
41 |
42 |

43 | 44 |
45 |
46 | get_current_phase(); 53 | 54 | $now = new DateTimeImmutable(); 55 | 56 | if ( 57 | null !== $phase && $phase->get_next_date() < $now 58 | && 59 | SubscriptionStatus::CANCELLED === $subscription->get_status() && 'gravityformsideal' === $subscription->get_source() 60 | ) { 61 | $phase = new SubscriptionPhase( $subscription, $now, $phase->get_interval(), $phase->get_amount() ); 62 | } 63 | 64 | $next_period = $phase->get_next_period(); 65 | 66 | // Maybe use period from last failed payment. 67 | $renewal_period = $subscription->get_renewal_period(); 68 | 69 | if ( null !== $renewal_period ) { 70 | $next_period = $renewal_period; 71 | } 72 | 73 | ?> 74 | 75 | 76 | 77 |

78 | 79 |

80 | 81 | 82 | 83 |

84 | human_readable_range( __( 'l j F Y', 'pronamic_ideal' ), _x( 'until', 'period separator', 'pronamic_ideal' ) ) ) 90 | ); 91 | 92 | ?> 93 |

94 | 95 |
96 | get_id(), 'pronamic_pay_renew_subscription_nonce' ); ?> 97 | 98 | 99 |
100 | 101 | 102 |
103 |
104 |
105 |
106 | 107 | 108 | -------------------------------------------------------------------------------- /views/widget-payments-status-list.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2005-2024 Pronamic 7 | * @license GPL-3.0-or-later 8 | * @package Pronamic\WordPress\Pay 9 | */ 10 | 11 | if ( ! defined( 'ABSPATH' ) ) { 12 | exit; 13 | } 14 | 15 | $counts = \wp_count_posts( 'pronamic_payment' ); 16 | 17 | $states = [ 18 | /* translators: %s: posts count value */ 19 | 'payment_completed' => __( '%s completed', 'pronamic_ideal' ), 20 | /* translators: %s: posts count value */ 21 | 'payment_pending' => __( '%s pending', 'pronamic_ideal' ), 22 | /* translators: %s: posts count value */ 23 | 'payment_cancelled' => __( '%s cancelled', 'pronamic_ideal' ), 24 | /* translators: %s: posts count value */ 25 | 'payment_failed' => __( '%s failed', 'pronamic_ideal' ), 26 | /* translators: %s: posts count value */ 27 | 'payment_expired' => __( '%s expired', 'pronamic_ideal' ), 28 | ]; 29 | 30 | $url = \add_query_arg( 31 | [ 32 | 'post_type' => 'pronamic_payment', 33 | ], 34 | \admin_url( 'edit.php' ) 35 | ); 36 | 37 | ?> 38 | 71 | --------------------------------------------------------------------------------