Plugin Directory

Changeset 3253989


Ignore:
Timestamp:
03/11/2025 11:50:32 AM (11 months ago)
Author:
hsuvant
Message:

Version 1.1.6

Location:
visma-pay-embedded-card-payment-gateway/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • visma-pay-embedded-card-payment-gateway/trunk/build/blocks.asset.php

    r2974591 r3253989  
    1 <?php return array('dependencies' => array('wp-element', 'wp-i18n'), 'version' => 'eca14a32dee6a5fa52b7');
     1<?php return array('dependencies' => array('wp-element', 'wp-i18n'), 'version' => 'c553693c98bb20bbfa99');
  • visma-pay-embedded-card-payment-gateway/trunk/build/blocks.js

    r2974591 r3253989  
    1 !function(){"use strict";var e=window.wp.element,t=window.wp.i18n;const{registerPaymentMethod:a}=wc.wcBlocksRegistry,{getSetting:n}=wc.wcSettings,r="https://www.vismapay.com",s=n("vismapay_embedded_card_data",{}),c={generic:`${(0,t.__)("Something went wrong","visma-pay-embedded-card-payment-gateway")}.`,formInvalid:`${(0,t.__)("Please check the card information","visma-pay-embedded-card-payment-gateway")}.`},i=()=>(0,e.createElement)("div",{id:"pf-cc-form"},(0,e.createElement)("iframe",{scrolling:"no",id:"pf-cc-iframe",className:"intrinsic-ignore",height:"220px",style:{border:"none",width:"100%"},src:`${r}/e-payments/embedded_card_form?lang=${s.lang}`})),m=()=>(s.visa||s.master||s.amex||s.diners)&&(0,e.createElement)("div",{className:"vpe-card-brand-row"},s.visa&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(l,{imgSrc:"visa.png",imgAlt:"Visa",imgClassNames:"visa"}),(0,e.createElement)(l,{imgSrc:"verified.png",imgAlt:"Verified by Visa",imgClassNames:"verified"})),s.mastercard&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(l,{imgSrc:"mastercard.png",imgAlt:"MasterCard"}),(0,e.createElement)(l,{imgSrc:"securecode.png",imgAlt:"MasterCard SecureCode"})),s.amex&&(0,e.createElement)(l,{imgSrc:"americanexpress.png",imgAlt:"America Express"}),s.diners&&(0,e.createElement)(l,{imgSrc:"dinersclub.png",imgAlt:"Diners"}),(0,e.createElement)("div",{style:{display:"block",clear:"both"}})),l=({imgSrc:t,imgAlt:a,imgClassNames:n=""})=>(0,e.createElement)("div",{className:"vpe-card-brand-container"},(0,e.createElement)("img",{className:`vpe-card-brand-logo ${n}`,src:`${s.imgUrl}/${t}`,alt:a})),o=({eventRegistration:a,emitResponse:n,components:s})=>{const{onCheckoutValidation:l,onPaymentSetup:o,onCheckoutSuccess:d,onCheckoutFail:g}=a,{responseTypes:p}=n,{LoadingMask:u}=s,[y,f]=(0,e.useState)(!1);let E=null;const v=e=>{if(e.origin!==r)return;let t=null;try{t=JSON.parse(e.data)}catch(e){}E=null!==t&&void 0!==t.valid&&!0===t.valid},w=async(e=3e3)=>{let t=!0,a=!1;for(setTimeout((()=>{null===E&&(t=!1)}),e);t&&!a;)if(null!==E)a=!0;else{const e=new Promise((e=>{setTimeout(e,100)}));await e}if(null===E)return Promise.reject()};(0,e.useEffect)((()=>(window.addEventListener("message",v),()=>{window.removeEventListener("message",v)})),[]),(0,e.useEffect)((()=>{const e=l((async()=>{f(!0);const e=document.querySelector("#pf-cc-iframe");if(!e)return f(!1),{errorMessage:c.generic};e.contentWindow.postMessage(JSON.stringify({action:"validate"}),r);try{await w()}catch(e){return f(!1),{errorMessage:c.generic}}return!!E||(f(!1),{errorMessage:c.formInvalid})}));return()=>{e()}}),[l]),(0,e.useEffect)((()=>{const e=o((()=>({type:p.SUCCESS,meta:{paymentMethodData:{payment_method:"visma_pay_embedded_card"}}})));return()=>{e()}}),[p.SUCCESS,o]),(0,e.useEffect)((()=>{const e=d((async e=>{const t=e?.processingResponse;if(t&&"success"===t?.paymentStatus&&"success"===t?.paymentDetails?.result&&t.paymentDetails.bpf_token){const e=document.querySelector("#pf-cc-iframe");if(!e)return f(!1),{type:p.ERROR,message:c.generic};const a={action:"pay",token:t.paymentDetails.bpf_token};e.contentWindow.postMessage(JSON.stringify(a),r);try{await w(5e3)}catch(e){return f(!1),{type:p.ERROR,message:c.generic}}return!!E||(f(!1),{type:p.ERROR,message:c.formInvalid})}return f(!1),{type:p.ERROR,message:c.generic}}));return()=>{e()}}),[p.ERROR,p.SUCCESS,d]),(0,e.useEffect)((()=>{const e=g((e=>(f(!1),!0)));return()=>{e()}}),[g]);const S=(0,e.createElement)("div",{id:"visma-pay-embedded-card-payment-content"},(0,e.createElement)("p",null,(0,t.__)("Payment card","visma-pay-embedded-card-payment-gateway")),(0,e.createElement)(i,null),(0,e.createElement)(m,null));return(0,e.createElement)(u,{isLoading:y,showSpinner:!0},S)};a({name:"visma_pay_embedded_card",label:(0,e.createElement)((t=>{const{PaymentMethodLabel:a}=t.components;return(0,e.createElement)(a,{text:s.title})}),null),ariaLabel:s.title,content:(0,e.createElement)(o,null),edit:(0,e.createElement)(o,null),canMakePayment:()=>!0,paymentMethodId:"visma_pay_embedded_card",supports:{features:s.supports}})}();
     1(()=>{"use strict";const e=window.wp.element,t=window.wp.i18n,{registerPaymentMethod:a}=wc.wcBlocksRegistry,{getSetting:n}=wc.wcSettings,r="https://www.vismapay.com",s=n("vismapay_embedded_card_data",{}),c={generic:`${(0,t.__)("Something went wrong","visma-pay-embedded-card-payment-gateway")}.`,formInvalid:`${(0,t.__)("Please check the card information","visma-pay-embedded-card-payment-gateway")}.`},i=()=>(0,e.createElement)("div",{id:"pf-cc-form"},(0,e.createElement)("iframe",{scrolling:"no",id:"pf-cc-iframe",className:"intrinsic-ignore",height:"220px",style:{border:"none",width:"100%"},src:`${r}/e-payments/embedded_card_form?lang=${s.lang}`})),m=()=>(s.visa||s.master||s.amex||s.diners)&&(0,e.createElement)("div",{className:"vpe-card-brand-row"},s.visa&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o,{imgSrc:"visa.png",imgAlt:"Visa",imgClassNames:"visa"}),(0,e.createElement)(o,{imgSrc:"verified.png",imgAlt:"Verified by Visa",imgClassNames:"verified"})),s.mastercard&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o,{imgSrc:"mastercard.png",imgAlt:"MasterCard"}),(0,e.createElement)(o,{imgSrc:"securecode.png",imgAlt:"MasterCard SecureCode"})),s.amex&&(0,e.createElement)(o,{imgSrc:"americanexpress.png",imgAlt:"America Express"}),s.diners&&(0,e.createElement)(o,{imgSrc:"dinersclub.png",imgAlt:"Diners"}),(0,e.createElement)("div",{style:{display:"block",clear:"both"}})),l=()=>s.onlyAuthorize&&(0,e.createElement)("div",{className:"woocommerce-info"},(0,t.sprintf)((0,t.__)("An authorization of 1 %s will be made on your card to save your card details. The authorization will be automatically cancelled after the order has been accepted.","visma-pay-embedded-card-payment-gateway"),s.currency)),o=({imgSrc:t,imgAlt:a,imgClassNames:n=""})=>(0,e.createElement)("div",{className:"vpe-card-brand-container"},(0,e.createElement)("img",{className:`vpe-card-brand-logo ${n}`,src:`${s.imgUrl}/${t}`,alt:a})),d=({eventRegistration:a,emitResponse:n,components:s})=>{const{onCheckoutValidation:o,onPaymentSetup:d,onCheckoutSuccess:p,onCheckoutFail:g}=a,{responseTypes:u}=n,{LoadingMask:y}=s,[f,E]=(0,e.useState)(!1);let v=null;const w=e=>{if(e.origin!==r)return;let t=null;try{t=JSON.parse(e.data)}catch(e){}v=null!==t&&void 0!==t.valid&&!0===t.valid},S=async(e=3e3)=>{let t=!0,a=!1;for(setTimeout((()=>{null===v&&(t=!1)}),e);t&&!a;)if(null!==v)a=!0;else{const e=new Promise((e=>{setTimeout(e,100)}));await e}if(null===v)return Promise.reject()};(0,e.useEffect)((()=>(window.addEventListener("message",w),()=>{window.removeEventListener("message",w)})),[]),(0,e.useEffect)((()=>{const e=o((async()=>{E(!0);const e=document.querySelector("#pf-cc-iframe");if(!e)return E(!1),{errorMessage:c.generic};e.contentWindow.postMessage(JSON.stringify({action:"validate"}),r);try{await S()}catch(e){return E(!1),{errorMessage:c.generic}}return!!v||(E(!1),{errorMessage:c.formInvalid})}));return()=>{e()}}),[o]),(0,e.useEffect)((()=>{const e=d((()=>({type:u.SUCCESS,meta:{paymentMethodData:{payment_method:"visma_pay_embedded_card"}}})));return()=>{e()}}),[u.SUCCESS,d]),(0,e.useEffect)((()=>{const e=p((async e=>{const t=e?.processingResponse;if(t&&"success"===t?.paymentStatus&&"success"===t?.paymentDetails?.result&&t.paymentDetails.bpf_token){const e=document.querySelector("#pf-cc-iframe");if(!e)return E(!1),{type:u.ERROR,message:c.generic};const a={action:"pay",token:t.paymentDetails.bpf_token};e.contentWindow.postMessage(JSON.stringify(a),r);try{await S(5e3)}catch(e){return E(!1),{type:u.ERROR,message:c.generic}}return!!v||(E(!1),{type:u.ERROR,message:c.formInvalid})}return E(!1),{type:u.ERROR,message:c.generic}}));return()=>{e()}}),[u.ERROR,u.SUCCESS,p]),(0,e.useEffect)((()=>{const e=g((e=>(E(!1),!0)));return()=>{e()}}),[g]);const b=(0,e.createElement)("div",{id:"visma-pay-embedded-card-payment-content"},(0,e.createElement)("p",null,(0,t.__)("Payment card","visma-pay-embedded-card-payment-gateway")),(0,e.createElement)(l,null),(0,e.createElement)(i,null),(0,e.createElement)(m,null));return(0,e.createElement)(y,{isLoading:f,showSpinner:!0},b)};a({name:"visma_pay_embedded_card",label:(0,e.createElement)((t=>{const{PaymentMethodLabel:a}=t.components;return(0,e.createElement)(a,{text:s.title})}),null),ariaLabel:s.title,content:(0,e.createElement)(d,null),edit:(0,e.createElement)(d,null),canMakePayment:()=>!0,paymentMethodId:"visma_pay_embedded_card",supports:{features:s.supports}})})();
  • visma-pay-embedded-card-payment-gateway/trunk/includes/blocks/visma_pay_embedded_card_blocks_support.php

    r2974591 r3253989  
    6060        $amex = false;
    6161        $diners = false;
     62        $only_authorize = false;
    6263
    6364        // blocks will also be rendered in the editor
     
    6970            $amex = $this->get_setting('amex_logo') === 'yes';
    7071            $diners = $this->get_setting('diners_logo') === 'yes';
     72            $only_authorize = $this->gateway->visma_pay_cart_has_free_trial();
    7173        }
    7274
     
    7981            'amex' => $amex,
    8082            'diners' => $diners,
    81             'supports' => array_filter($this->gateway->supports, [$this->gateway, 'supports'])
     83            'supports' => array_filter($this->gateway->supports, [$this->gateway, 'supports']),
     84            'onlyAuthorize' => $only_authorize,
     85            'currency' => get_woocommerce_currency(),
    8286        ];
    8387    }
  • visma-pay-embedded-card-payment-gateway/trunk/includes/lib/Visma/VismaPay.php

    r3149117 r3253989  
    7171            $payment_data['plugin_info'] .= '0';
    7272
    73         $payment_data['plugin_info'] .= '|1.1.5';
     73        $payment_data['plugin_info'] .= '|1.1.6';
    7474
    7575        return $this->makeRequest($url, $payment_data);
  • visma-pay-embedded-card-payment-gateway/trunk/languages/visma-pay-embedded-card-payment-gateway-fi-0a194271922d454324b7e88e0bfed673.json

    r2974591 r3253989  
    1 {"translation-revision-date":"2023-09-27 09:50+0300","generator":"WP-CLI\/2.8.1","source":"build\/blocks.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fi","plural-forms":"nplurals=2; plural=n != 1;"},"Payment card":["Maksukortti"],"Something went wrong":["Jokin meni pieleen"],"Please check the card information":["Tarkista maksukortin tiedot"]}}}
     1{"translation-revision-date":"2025-03-06 12:46+0200","generator":"WP-CLI\/2.11.0","source":"build\/blocks.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"fi","plural-forms":"nplurals=2; plural=n != 1;"},"Payment card":["Maksukortti"],"An authorization of 1 %s will be made on your card to save your card details. The authorization will be automatically cancelled after the order has been accepted.":["Kortillesi tehd\u00e4\u00e4n katevaraus (1 %s) korttitietojesi tallentamista varten. Katevaraus perutaan automaattisesti kun tilaus on hyv\u00e4ksytty."],"Something went wrong":["Jokin meni pieleen"],"Please check the card information":["Tarkista maksukortin tiedot"]}}}
  • visma-pay-embedded-card-payment-gateway/trunk/languages/visma-pay-embedded-card-payment-gateway-fi.po

    r2974591 r3253989  
    44"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/visma-pay-"
    55"embedded-card-payment-gateway\n"
    6 "POT-Creation-Date: 2023-10-03T13:10:45+00:00\n"
    7 "PO-Revision-Date: 2023-10-03 16:11+0300\n"
     6"POT-Creation-Date: 2025-03-06T10:35:29+00:00\n"
     7"PO-Revision-Date: 2025-03-06 12:46+0200\n"
    88"Last-Translator: Visma Pay <[email protected]>\n"
    99"Language-Team: Suomi\n"
     
    1313"Content-Transfer-Encoding: 8bit\n"
    1414"Plural-Forms: nplurals=2; plural=n != 1;\n"
    15 "X-Generator: Poedit 3.4\n"
     15"X-Generator: Poedit 3.5\n"
    1616"X-Loco-Version: 2.5.0; wp-5.6\n"
    1717
    1818#. Plugin Name of the plugin
     19#: visma-pay-embedded-card-payment-gateway.php
    1920msgid "Visma Pay Embedded Card Payment Gateway"
    2021msgstr "Visma Pay (Upotettu korttimaksaminen) maksulisäosa"
    2122
    2223#. Plugin URI of the plugin
     24#: visma-pay-embedded-card-payment-gateway.php
    2325msgid "https://www.vismapay.com/docs"
    2426msgstr "https://www.vismapay.com/docs"
    2527
    2628#. Description of the plugin
     29#: visma-pay-embedded-card-payment-gateway.php
    2730msgid "Visma Pay Payment Gateway Embedded Card Integration for Woocommerce"
    2831msgstr ""
     
    3134
    3235#. Author of the plugin
     36#: visma-pay-embedded-card-payment-gateway.php
    3337msgid "Visma"
    3438msgstr "Visma"
    3539
    3640#. Author URI of the plugin
     41#: visma-pay-embedded-card-payment-gateway.php
    3742msgid "https://www.visma.fi/vismapay/"
    3843msgstr "https://www.visma.fi/vismapay/"
    3944
    40 #: visma-pay-embedded-card-payment-gateway.php:77
    41 #: visma-pay-embedded-card-payment-gateway.php:173
     45#: visma-pay-embedded-card-payment-gateway.php:80
     46#: visma-pay-embedded-card-payment-gateway.php:177
    4247msgid "Visma Pay (Embedded Card)"
    4348msgstr "Visma Pay (Upotettu korttimaksaminen)"
    4449
    45 #: visma-pay-embedded-card-payment-gateway.php:78
     50#: visma-pay-embedded-card-payment-gateway.php:81
    4651msgid ""
    4752"Visma Pay (Embedded Card) w3-API Payment Gateway integration for Woocommerce"
     
    5055"Woocommerceen"
    5156
    52 #: visma-pay-embedded-card-payment-gateway.php:159
     57#: visma-pay-embedded-card-payment-gateway.php:163
    5358msgid "General options"
    5459msgstr "Yleiset asetukset"
    5560
    56 #: visma-pay-embedded-card-payment-gateway.php:164
     61#: visma-pay-embedded-card-payment-gateway.php:168
    5762msgid "Enable/Disable"
    5863msgstr "Ota käyttöön / Poista käytöstä"
    5964
    60 #: visma-pay-embedded-card-payment-gateway.php:166
     65#: visma-pay-embedded-card-payment-gateway.php:170
    6166msgid "Enable Visma Pay (Embedded Card)"
    6267msgstr "Ota Visma Pay (Upotettu korttimaksaminen) käyttöön"
    6368
    64 #: visma-pay-embedded-card-payment-gateway.php:170
     69#: visma-pay-embedded-card-payment-gateway.php:174
    6570msgid "Title"
    6671msgstr "Otsikko"
    6772
    68 #: visma-pay-embedded-card-payment-gateway.php:172
     73#: visma-pay-embedded-card-payment-gateway.php:176
    6974msgid "This controls the title which the user sees during checkout."
    7075msgstr "Maksutavan kassasivulla näkyvä otsikko."
    7176
    72 #: visma-pay-embedded-card-payment-gateway.php:176
     77#: visma-pay-embedded-card-payment-gateway.php:180
    7378msgid "Private key"
    7479msgstr "Yksityinen salausavain"
    7580
    76 #: visma-pay-embedded-card-payment-gateway.php:178
     81#: visma-pay-embedded-card-payment-gateway.php:182
    7782msgid "Private key of the sub-merchant"
    7883msgstr "Alikauppiaan yksityinen salausavain"
    7984
    80 #: visma-pay-embedded-card-payment-gateway.php:182
     85#: visma-pay-embedded-card-payment-gateway.php:186
    8186msgid "API key"
    8287msgstr "Rajapinta-avain"
    8388
    84 #: visma-pay-embedded-card-payment-gateway.php:184
     89#: visma-pay-embedded-card-payment-gateway.php:188
    8590msgid "API key of the sub-merchant"
    8691msgstr "Alikauppiaan yksityinen rajapinta-avain"
    8792
    88 #: visma-pay-embedded-card-payment-gateway.php:188
     93#: visma-pay-embedded-card-payment-gateway.php:192
    8994msgid "Order number prefix"
    9095msgstr "Tilausnumeron etuliite"
    9196
    92 #: visma-pay-embedded-card-payment-gateway.php:190
     97#: visma-pay-embedded-card-payment-gateway.php:194
    9398msgid "Prefix to avoid order number duplication"
    9499msgstr ""
     
    96101"kauppiastunnus on käytössä useassa verkkokaupassa. (Valinnainen)"
    97102
    98 #: visma-pay-embedded-card-payment-gateway.php:194
     103#: visma-pay-embedded-card-payment-gateway.php:198
    99104msgid "Send products"
    100105msgstr "Lähetä tuote-erittely"
    101106
    102 #: visma-pay-embedded-card-payment-gateway.php:196
     107#: visma-pay-embedded-card-payment-gateway.php:200
    103108msgid "Send product breakdown to Visma Pay (Embedded Card)."
    104109msgstr "Lähetä tuote-erittely Visma Payn maksurajapintaan."
    105110
    106 #: visma-pay-embedded-card-payment-gateway.php:200
     111#: visma-pay-embedded-card-payment-gateway.php:204
    107112msgid "Send payment confirmation"
    108113msgstr "Maksuvahvistus"
    109114
    110 #: visma-pay-embedded-card-payment-gateway.php:202
     115#: visma-pay-embedded-card-payment-gateway.php:206
    111116msgid ""
    112117"Send Visma Pay (Embedded Card)'s payment confirmation email to the "
     
    116121"maksutapahtumasta."
    117122
    118 #: visma-pay-embedded-card-payment-gateway.php:206
     123#: visma-pay-embedded-card-payment-gateway.php:210
    119124msgid "Only allow payments in EUR"
    120125msgstr "Salli maksaminen vain euroilla"
    121126
    122 #: visma-pay-embedded-card-payment-gateway.php:208
     127#: visma-pay-embedded-card-payment-gateway.php:212
    123128msgid "Enable this option if you want to allow payments only in EUR."
    124129msgstr "Ota asetus käyttöön jos haluat sallia maksaminen ainoastaan euroilla."
    125130
    126 #: visma-pay-embedded-card-payment-gateway.php:212
     131#: visma-pay-embedded-card-payment-gateway.php:216
     132msgid "Allow free trial"
     133msgstr "Salli ilmainen kokeilu"
     134
     135#: visma-pay-embedded-card-payment-gateway.php:218
     136msgid "Enable to allow using free trial on WC Subscription products"
     137msgstr ""
     138"Ota asetus käyttöön jos haluat sallia ilmaisen kokeilun kestotilauksissa (WC "
     139"Subscriptions)"
     140
     141#: visma-pay-embedded-card-payment-gateway.php:219
     142msgid ""
     143"When this option is enabled, the plugin will create an authorization of 100 "
     144"fractional monetary units. The currency depends on your store's settings. "
     145"The authorization is required to save the payment card. After the order is "
     146"completed, the authorization will be automatically canceled. For example, "
     147"when using EUR, the authorization will be 1.00 EUR."
     148msgstr ""
     149"Kun tämä asetus on käytössä, liitännäinen luo 100 sentin katevarauksen. "
     150"Valuutta riippuu kaupan asetuksista. Katevaraus tarvitaan maksukortin "
     151"tallentamiseen. Kun tilaus on suoritettu, katevaraus peruutetaan "
     152"automaattisesti. Esimerkiksi käytettäessä euroa (EUR) katevarauksen summa on "
     153"1,00 EUR."
     154
     155#: visma-pay-embedded-card-payment-gateway.php:223
    127156msgid "Cancel Page"
    128157msgstr "Peruutetun maksun paluusivu"
    129158
    130 #: visma-pay-embedded-card-payment-gateway.php:215
     159#: visma-pay-embedded-card-payment-gateway.php:226
    131160msgid ""
    132161"Choose the page where the customer is redirected after a canceled/failed "
     
    136165"jälkeen."
    137166
    138 #: visma-pay-embedded-card-payment-gateway.php:216
     167#: visma-pay-embedded-card-payment-gateway.php:227
    139168msgid ""
    140169"Order Received: Shows the customer information about their order and a "
     
    146175"maksamista uudelleen."
    147176
    148 #: visma-pay-embedded-card-payment-gateway.php:217
     177#: visma-pay-embedded-card-payment-gateway.php:228
    149178msgid ""
    150179"Pay for Order: Returns user to a page where they can try to pay their unpaid "
     
    152181msgstr ""
    153182"Maksa Tilaus: Siirtää asiakkaan sivulle jossa hän voi yrittää uudelleen "
    154 "maksamattoman tilauksensa maksamista."
    155 
    156 #: visma-pay-embedded-card-payment-gateway.php:218
     183"maksamattoman tilauksensa maksamista. "
     184
     185#: visma-pay-embedded-card-payment-gateway.php:229
    157186msgid "Cart: Customer is redirected back to the shopping cart."
    158187msgstr "Ostoskori: Asiakas siirretään takaisin ostoskori-sivulle."
    159188
    160 #: visma-pay-embedded-card-payment-gateway.php:219
     189#: visma-pay-embedded-card-payment-gateway.php:230
    161190msgid "Checkout: Customer is redirected back to the checkout."
    162191msgstr "Kassa: Asiakas siirretään takaisin verkkokaupan kassalle."
    163192
    164 #: visma-pay-embedded-card-payment-gateway.php:220
     193#: visma-pay-embedded-card-payment-gateway.php:231
    165194msgid ""
    166195"(When using Cart or Checkout as the return page for failed orders, the "
     
    171200"yhteydessä )"
    172201
    173 #: visma-pay-embedded-card-payment-gateway.php:223
     202#: visma-pay-embedded-card-payment-gateway.php:234
    174203msgid "Order Received"
    175204msgstr "Tilaus vastaanotettu"
    176205
    177 #: visma-pay-embedded-card-payment-gateway.php:224
     206#: visma-pay-embedded-card-payment-gateway.php:235
    178207msgid "Pay for Order"
    179208msgstr "Maksa Tilaus"
    180209
    181 #: visma-pay-embedded-card-payment-gateway.php:225
     210#: visma-pay-embedded-card-payment-gateway.php:236
    182211msgid "Cart"
    183212msgstr "Ostoskori"
    184213
    185 #: visma-pay-embedded-card-payment-gateway.php:226
     214#: visma-pay-embedded-card-payment-gateway.php:237
    186215msgid "Checkout"
    187216msgstr "Kassa"
    188217
    189 #: visma-pay-embedded-card-payment-gateway.php:230
     218#: visma-pay-embedded-card-payment-gateway.php:241
    190219msgid "Display card logos"
    191220msgstr "Näytä maksukorttien logot"
    192221
    193 #: visma-pay-embedded-card-payment-gateway.php:235
     222#: visma-pay-embedded-card-payment-gateway.php:246
    194223msgid "Visa"
    195224msgstr "Visa"
    196225
    197 #: visma-pay-embedded-card-payment-gateway.php:237
     226#: visma-pay-embedded-card-payment-gateway.php:248
    198227msgid "Display Visa and Verified by Visa logo below the form."
    199228msgstr "Näytä Visa ja Verified by Visa logo maksulomakkeen alapuolelle."
    200229
    201 #: visma-pay-embedded-card-payment-gateway.php:241
     230#: visma-pay-embedded-card-payment-gateway.php:252
    202231msgid "Mastercard"
    203232msgstr "Mastercard"
    204233
    205 #: visma-pay-embedded-card-payment-gateway.php:243
     234#: visma-pay-embedded-card-payment-gateway.php:254
    206235msgid "Display Mastercard and Mastercard SecureCode logo below the form."
    207236msgstr ""
    208237"Näytä Mastercard ja Mastercard SecureCode logo maksulomakkeen alapuolelle."
    209238
    210 #: visma-pay-embedded-card-payment-gateway.php:247
     239#: visma-pay-embedded-card-payment-gateway.php:258
    211240msgid "American Express"
    212241msgstr "American Express"
    213242
    214 #: visma-pay-embedded-card-payment-gateway.php:249
     243#: visma-pay-embedded-card-payment-gateway.php:260
    215244msgid "Display American Express logo below the form."
    216245msgstr "Näytä American Expressin logo maksulomakkeen alapuolelle."
    217246
    218 #: visma-pay-embedded-card-payment-gateway.php:253
     247#: visma-pay-embedded-card-payment-gateway.php:264
    219248msgid "Diners Club"
    220249msgstr "Diners Club"
    221250
    222 #: visma-pay-embedded-card-payment-gateway.php:255
     251#: visma-pay-embedded-card-payment-gateway.php:266
    223252msgid "Display Diners Club logo below the form."
    224253msgstr "Näytä Diners Clubin logo maksulomakkeen alapuolelle."
    225254
    226 #: visma-pay-embedded-card-payment-gateway.php:274 build/blocks.js:1
     255#: visma-pay-embedded-card-payment-gateway.php:286 build/blocks.js:1
    227256msgid "Payment card"
    228257msgstr "Maksukortti"
    229258
    230 #: visma-pay-embedded-card-payment-gateway.php:416
    231 #: visma-pay-embedded-card-payment-gateway.php:417
    232 #: visma-pay-embedded-card-payment-gateway.php:432
     259#: visma-pay-embedded-card-payment-gateway.php:293 build/blocks.js:1
     260msgid ""
     261"An authorization of 1 %s will be made on your card to save your card "
     262"details. The authorization will be automatically cancelled after the order "
     263"has been accepted."
     264msgstr ""
     265"Kortillesi tehdään katevaraus (1 %s) korttitietojesi tallentamista varten. "
     266"Katevaraus perutaan automaattisesti kun tilaus on hyväksytty."
     267
     268#: visma-pay-embedded-card-payment-gateway.php:383
     269msgid ""
     270"Visma Pay (Embedded Card): Creating a temporary authorization to save card "
     271"token."
     272msgstr ""
     273"Visma Pay (Upotettu korttimaksaminen): Luodaan väliaikainen katevaraus "
     274"korttitokenin tallentamista varten."
     275
     276#: visma-pay-embedded-card-payment-gateway.php:448
     277#: visma-pay-embedded-card-payment-gateway.php:449
     278#: visma-pay-embedded-card-payment-gateway.php:464
    233279msgid "Visma Pay: No payment methods available for the currency: "
    234 msgstr "Visma Pay: Ei sallittuja maksutapoja valuutalle:"
    235 
    236 #: visma-pay-embedded-card-payment-gateway.php:430
     280msgstr "Visma Pay: Ei sallittuja maksutapoja valuutalle: "
     281
     282#: visma-pay-embedded-card-payment-gateway.php:462
    237283msgid ""
    238284"Visma Pay: \"Only allow payments in EUR\" is enabled and currency was not "
     
    240286msgstr ""
    241287"Visma Pay: \"Salli maksaminen vain euroilla\"-asetus on käytössä ja valuutta "
    242 "ei ollut EUR tilauksessa:"
    243 
    244 #: visma-pay-embedded-card-payment-gateway.php:443
    245 #: visma-pay-embedded-card-payment-gateway.php:605
    246 #: visma-pay-embedded-card-payment-gateway.php:607
     288"ei ollut EUR tilauksessa: "
     289
     290#: visma-pay-embedded-card-payment-gateway.php:475
     291#: visma-pay-embedded-card-payment-gateway.php:638
     292#: visma-pay-embedded-card-payment-gateway.php:640
    247293msgid "Visma Pay (Embedded Card) order"
    248294msgstr "Visma Pay (Upotettu korttimaksaminen) tilaus"
    249295
    250 #: visma-pay-embedded-card-payment-gateway.php:443
     296#: visma-pay-embedded-card-payment-gateway.php:475
    251297msgid "Payment pending. Waiting for result."
    252298msgstr "Maksaminen kesken. Odottaa tulosta."
    253299
    254 #: visma-pay-embedded-card-payment-gateway.php:465
     300#: visma-pay-embedded-card-payment-gateway.php:497
    255301msgid ""
    256302"Visma Pay (Embedded Card) system is currently in maintenance. Please try "
     
    260306"kuluttua uudelleen."
    261307
    262 #: visma-pay-embedded-card-payment-gateway.php:471
    263 #: visma-pay-embedded-card-payment-gateway.php:485
     308#: visma-pay-embedded-card-payment-gateway.php:503
     309#: visma-pay-embedded-card-payment-gateway.php:517
    264310msgid "Payment failed due to an error."
    265311msgstr "Maksu epäonnistui - Tapahtui virhe."
    266312
    267 #: visma-pay-embedded-card-payment-gateway.php:573
     313#: visma-pay-embedded-card-payment-gateway.php:604
    268314msgid "Payment method: Card payment"
    269315msgstr "Maksutapa: Korttimaksu"
    270316
    271 #: visma-pay-embedded-card-payment-gateway.php:574
     317#: visma-pay-embedded-card-payment-gateway.php:605
    272318msgid "Card payment info: "
    273319msgstr "Korttimaksun lisätiedot: "
    274320
    275 #: visma-pay-embedded-card-payment-gateway.php:579
     321#: visma-pay-embedded-card-payment-gateway.php:610
    276322msgid "Verified: "
    277323msgstr "Varmennus: "
    278324
    279 #: visma-pay-embedded-card-payment-gateway.php:582
     325#: visma-pay-embedded-card-payment-gateway.php:613
    280326msgid "Card country: "
    281327msgstr "Kortin maakoodi: "
    282328
    283 #: visma-pay-embedded-card-payment-gateway.php:583
     329#: visma-pay-embedded-card-payment-gateway.php:614
    284330msgid "Client IP country: "
    285331msgstr "Asiakkaan IP:n maakoodi: "
    286332
    287 #: visma-pay-embedded-card-payment-gateway.php:588
     333#: visma-pay-embedded-card-payment-gateway.php:619
    288334msgid "Error: "
    289335msgstr "Virhe: "
    290336
    291 #: visma-pay-embedded-card-payment-gateway.php:593
     337#: visma-pay-embedded-card-payment-gateway.php:624
    292338msgid "Payment method: "
    293339msgstr "Valittu maksutapa: "
    294340
    295 #: visma-pay-embedded-card-payment-gateway.php:605
    296 #: visma-pay-embedded-card-payment-gateway.php:894
     341#: visma-pay-embedded-card-payment-gateway.php:638
     342#: visma-pay-embedded-card-payment-gateway.php:957
    297343msgid "Payment is authorized. Use settle option to capture funds."
    298344msgstr ""
    299345"Maksu varmennettu. Maksu veloitetaan painamalla Veloita maksu -painiketta."
    300346
    301 #: visma-pay-embedded-card-payment-gateway.php:607
    302 #: visma-pay-embedded-card-payment-gateway.php:898
     347#: visma-pay-embedded-card-payment-gateway.php:640
     348#: visma-pay-embedded-card-payment-gateway.php:961
    303349msgid "Payment accepted."
    304 msgstr "Maksu hyväksytty"
    305 
    306 #: visma-pay-embedded-card-payment-gateway.php:618
     350msgstr "Maksu hyväksytty."
     351
     352#: visma-pay-embedded-card-payment-gateway.php:651
    307353msgid "Card token: "
    308 msgstr "Korttitokeni:"
    309 
    310 #: visma-pay-embedded-card-payment-gateway.php:619
     354msgstr "Korttitokeni: "
     355
     356#: visma-pay-embedded-card-payment-gateway.php:652
    311357msgid "Expiration: "
    312 msgstr "Erääntyminen:"
    313 
    314 #: visma-pay-embedded-card-payment-gateway.php:645
     358msgstr "Erääntyminen: "
     359
     360#: visma-pay-embedded-card-payment-gateway.php:679
     361msgid ""
     362"Visma Pay (Embedded Card): Succesfully cancelled temporary authorization."
     363msgstr ""
     364"Visma Pay (Upotettu korttimaksaminen): Väliaikainen katevaraus peruttu "
     365"onnistuneesti."
     366
     367#: visma-pay-embedded-card-payment-gateway.php:686
     368msgid ""
     369"Visma Pay (Embedded Card): Failed to cancel temporary authorization. You "
     370"should cancel the authorization using Visma Pay merchant portal."
     371msgstr ""
     372"Visma Pay (Upotettu korttimaksaminen): Katevarauksen peruminen epäonnistui. "
     373"Teidän tulisi perua katevaraus Visma Payn kauppiasportaalissa."
     374
     375#: visma-pay-embedded-card-payment-gateway.php:708
    315376msgid "Payment was not accepted."
    316377msgstr "Maksu epäonnistui tai se keskeytettiin."
    317378
    318 #: visma-pay-embedded-card-payment-gateway.php:653
     379#: visma-pay-embedded-card-payment-gateway.php:716
    319380msgid ""
    320381"Transaction status could not be updated after customer returned from the web "
     
    325386"tila."
    326387
    327 #: visma-pay-embedded-card-payment-gateway.php:661
     388#: visma-pay-embedded-card-payment-gateway.php:724
    328389msgid ""
    329390"Maintenance break. The transaction is not created and the user has been "
     
    331392msgstr "Huoltotauko. Maksua ei luotu, ja asiakaalle on ilmoitettu asiasta."
    332393
    333 #: visma-pay-embedded-card-payment-gateway.php:691
     394#: visma-pay-embedded-card-payment-gateway.php:754
    334395msgid "Card payment failed. Your card has not been charged."
    335396msgstr ""
     
    337398"valitkaa jokin toinen maksutapa."
    338399
    339 #: visma-pay-embedded-card-payment-gateway.php:693
     400#: visma-pay-embedded-card-payment-gateway.php:756
    340401msgid "Payment was canceled or charge was not accepted."
    341402msgstr "Maksu keskeytettiin tai maksun veloitus epäonnistui."
    342403
    343 #: visma-pay-embedded-card-payment-gateway.php:722
     404#: visma-pay-embedded-card-payment-gateway.php:785
    344405msgid "The card is reported lost or stolen."
    345406msgstr "Kortti on ilmoitettu kadonneeksi tai varastetuksi."
    346407
    347 #: visma-pay-embedded-card-payment-gateway.php:724
     408#: visma-pay-embedded-card-payment-gateway.php:787
    348409msgid ""
    349410"General decline. The card holder should contact the issuer to find out why "
     
    353414"selvittääkseen miksi maksu epäonnistui."
    354415
    355 #: visma-pay-embedded-card-payment-gateway.php:726
     416#: visma-pay-embedded-card-payment-gateway.php:789
    356417msgid ""
    357418"Insufficient funds. The card holder should verify that there is balance on "
     
    361422"katetta ja verkkomaksaminen on aktivoitu kortille."
    362423
    363 #: visma-pay-embedded-card-payment-gateway.php:728
     424#: visma-pay-embedded-card-payment-gateway.php:791
    364425msgid "Expired card."
    365426msgstr "Vanhentunut kortti."
    366427
    367 #: visma-pay-embedded-card-payment-gateway.php:730
     428#: visma-pay-embedded-card-payment-gateway.php:793
    368429msgid "Withdrawal amount limit exceeded."
    369430msgstr "Kortin maksuraja ylittyi."
    370431
    371 #: visma-pay-embedded-card-payment-gateway.php:732
     432#: visma-pay-embedded-card-payment-gateway.php:795
    372433msgid ""
    373434"Restricted card. The card holder should verify that the online payments are "
     
    377438"aktivoitu kortille."
    378439
    379 #: visma-pay-embedded-card-payment-gateway.php:734
     440#: visma-pay-embedded-card-payment-gateway.php:797
    380441msgid ""
    381442"Timeout communicating with the acquirer. The payment should be tried again "
     
    384445"Yhteysongelma korttimaksujen prosessoijaan. Maksua tulisi yrittää uudelleen."
    385446
    386 #: visma-pay-embedded-card-payment-gateway.php:745
     447#: visma-pay-embedded-card-payment-gateway.php:808
    387448msgid "3-D Secure was used."
    388449msgstr "3-D Secure varmennettu tapahtuma."
    389450
    390 #: visma-pay-embedded-card-payment-gateway.php:747
     451#: visma-pay-embedded-card-payment-gateway.php:810
    391452msgid "3-D Secure was not used."
    392453msgstr "3-D Secure varmennusta ei käytetty."
    393454
    394 #: visma-pay-embedded-card-payment-gateway.php:749
     455#: visma-pay-embedded-card-payment-gateway.php:812
    395456msgid ""
    396457"3-D Secure was attempted but not supported by the card issuer or the card "
     
    400461"käytä varmennusta."
    401462
    402 #: visma-pay-embedded-card-payment-gateway.php:774
     463#: visma-pay-embedded-card-payment-gateway.php:837
    403464msgid "Payment settled."
    404465msgstr "Maksu veloitettu."
    405466
    406 #: visma-pay-embedded-card-payment-gateway.php:792
     467#: visma-pay-embedded-card-payment-gateway.php:855
    407468msgid "Settle payment"
    408469msgstr "Veloita maksu"
    409470
    410 #: visma-pay-embedded-card-payment-gateway.php:816
     471#: visma-pay-embedded-card-payment-gateway.php:879
    411472msgid "Settlement was successful."
    412473msgstr "Maksu veloitettiin onnistuneesti."
    413474
    414 #: visma-pay-embedded-card-payment-gateway.php:819
     475#: visma-pay-embedded-card-payment-gateway.php:882
    415476msgid "Settlement failed. Validation failed."
    416477msgstr "Veloitus epäonnistui. Validointi epäonnistui."
    417478
    418 #: visma-pay-embedded-card-payment-gateway.php:822
     479#: visma-pay-embedded-card-payment-gateway.php:885
    419480msgid ""
    420481"Settlement failed. Either the payment has already been settled or the "
     
    422483msgstr ""
    423484"Maksua ei voitu veloittaa. Joko maksu on jo veloitettu, tai luottolaitos "
    424 "hylkäsi veloituspyynnön"
    425 
    426 #: visma-pay-embedded-card-payment-gateway.php:825
     485"hylkäsi veloituspyynnön."
     486
     487#: visma-pay-embedded-card-payment-gateway.php:888
    427488msgid "Settlement failed. Unknown error."
    428489msgstr ""
     
    430491"asiakaspalveluumme."
    431492
    432 #: visma-pay-embedded-card-payment-gateway.php:832
     493#: visma-pay-embedded-card-payment-gateway.php:895
    433494msgid "Exception, error: "
    434495msgstr "Exception, virhe: "
    435496
    436 #: visma-pay-embedded-card-payment-gateway.php:894
    437 #: visma-pay-embedded-card-payment-gateway.php:898
     497#: visma-pay-embedded-card-payment-gateway.php:957
     498#: visma-pay-embedded-card-payment-gateway.php:961
    438499msgid "Visma Pay (Embedded Card, Subscription) order"
    439500msgstr "Visma Pay (Upotettu korttimaksaminen, Subscription) tilaus"
    440501
    441 #: visma-pay-embedded-card-payment-gateway.php:907
     502#: visma-pay-embedded-card-payment-gateway.php:970
    442503msgid "Duplicate order number."
    443 msgstr "Duplikaatti tilausnumero"
    444 
    445 #: visma-pay-embedded-card-payment-gateway.php:911
     504msgstr "Duplikaatti tilausnumero."
     505
     506#: visma-pay-embedded-card-payment-gateway.php:974
    446507msgid "Card token not found."
    447508msgstr "Korttitokenia ei löytynyt."
    448509
    449 #: visma-pay-embedded-card-payment-gateway.php:936
     510#: visma-pay-embedded-card-payment-gateway.php:999
    450511msgid "Payment failed. The card was not charged. Error: "
    451512msgstr "Maksu epäonnistui. Korttia ei veloitettu. Virhe: "
    452513
    453 #: visma-pay-embedded-card-payment-gateway.php:936
     514#: visma-pay-embedded-card-payment-gateway.php:999
    454515msgid "Payment failed. The card was not charged."
    455516msgstr "Maksu epäonnistui. Korttia ei veloitettu."
    456517
    457 #: visma-pay-embedded-card-payment-gateway.php:945
     518#: visma-pay-embedded-card-payment-gateway.php:1008
    458519msgid "Payment failed. Exception: "
    459520msgstr "Maksu epäonnistui. Exception: "
    460521
    461 #: visma-pay-embedded-card-payment-gateway.php:983
     522#: visma-pay-embedded-card-payment-gateway.php:1046
    462523msgid "Failed to delete the card token %s. Return code: %s"
    463524msgstr "Korttitokenin %s poisto epäonnistui. Paluukoodi: %s"
    464525
    465 #: visma-pay-embedded-card-payment-gateway.php:988
     526#: visma-pay-embedded-card-payment-gateway.php:1051
    466527msgid "Failed to delete the card token %s. Exception: %s"
    467528msgstr "Korttitokenin %s poisto epäonnistui. Exception: %s"
  • visma-pay-embedded-card-payment-gateway/trunk/languages/visma-pay-embedded-card-payment-gateway.pot

    r2974591 r3253989  
    1 # Copyright (C) 2023 Visma
     1# Copyright (C) 2025 Visma
    22# This file is distributed under the same license as the Visma Pay Embedded Card Payment Gateway plugin.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Visma Pay Embedded Card Payment Gateway 1.1.2\n"
     5"Project-Id-Version: Visma Pay Embedded Card Payment Gateway 1.1.6\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/visma-pay-embedded-card-payment-gateway\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2023-10-03T13:10:45+00:00\n"
     12"POT-Creation-Date: 2025-03-06T10:35:29+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.8.1\n"
     14"X-Generator: WP-CLI 2.11.0\n"
    1515"X-Domain: visma-pay-embedded-card-payment-gateway\n"
    1616
    1717#. Plugin Name of the plugin
     18#: visma-pay-embedded-card-payment-gateway.php
    1819msgid "Visma Pay Embedded Card Payment Gateway"
    1920msgstr ""
    2021
    2122#. Plugin URI of the plugin
     23#: visma-pay-embedded-card-payment-gateway.php
    2224msgid "https://www.vismapay.com/docs"
    2325msgstr ""
    2426
    2527#. Description of the plugin
     28#: visma-pay-embedded-card-payment-gateway.php
    2629msgid "Visma Pay Payment Gateway Embedded Card Integration for Woocommerce"
    2730msgstr ""
    2831
    2932#. Author of the plugin
     33#: visma-pay-embedded-card-payment-gateway.php
    3034msgid "Visma"
    3135msgstr ""
    3236
    3337#. Author URI of the plugin
     38#: visma-pay-embedded-card-payment-gateway.php
    3439msgid "https://www.visma.fi/vismapay/"
    3540msgstr ""
    3641
    37 #: visma-pay-embedded-card-payment-gateway.php:77
    38 #: visma-pay-embedded-card-payment-gateway.php:173
     42#: visma-pay-embedded-card-payment-gateway.php:80
     43#: visma-pay-embedded-card-payment-gateway.php:177
    3944msgid "Visma Pay (Embedded Card)"
    4045msgstr ""
    4146
    42 #: visma-pay-embedded-card-payment-gateway.php:78
     47#: visma-pay-embedded-card-payment-gateway.php:81
    4348msgid "Visma Pay (Embedded Card) w3-API Payment Gateway integration for Woocommerce"
    4449msgstr ""
    4550
    46 #: visma-pay-embedded-card-payment-gateway.php:159
     51#: visma-pay-embedded-card-payment-gateway.php:163
    4752msgid "General options"
    4853msgstr ""
    4954
    50 #: visma-pay-embedded-card-payment-gateway.php:164
     55#: visma-pay-embedded-card-payment-gateway.php:168
    5156msgid "Enable/Disable"
    5257msgstr ""
    5358
    54 #: visma-pay-embedded-card-payment-gateway.php:166
     59#: visma-pay-embedded-card-payment-gateway.php:170
    5560msgid "Enable Visma Pay (Embedded Card)"
    5661msgstr ""
    5762
    58 #: visma-pay-embedded-card-payment-gateway.php:170
     63#: visma-pay-embedded-card-payment-gateway.php:174
    5964msgid "Title"
    6065msgstr ""
    6166
    62 #: visma-pay-embedded-card-payment-gateway.php:172
     67#: visma-pay-embedded-card-payment-gateway.php:176
    6368msgid "This controls the title which the user sees during checkout."
    6469msgstr ""
    6570
    66 #: visma-pay-embedded-card-payment-gateway.php:176
     71#: visma-pay-embedded-card-payment-gateway.php:180
    6772msgid "Private key"
    6873msgstr ""
    6974
    70 #: visma-pay-embedded-card-payment-gateway.php:178
     75#: visma-pay-embedded-card-payment-gateway.php:182
    7176msgid "Private key of the sub-merchant"
    7277msgstr ""
    7378
    74 #: visma-pay-embedded-card-payment-gateway.php:182
     79#: visma-pay-embedded-card-payment-gateway.php:186
    7580msgid "API key"
    7681msgstr ""
    7782
    78 #: visma-pay-embedded-card-payment-gateway.php:184
     83#: visma-pay-embedded-card-payment-gateway.php:188
    7984msgid "API key of the sub-merchant"
    8085msgstr ""
    8186
    82 #: visma-pay-embedded-card-payment-gateway.php:188
     87#: visma-pay-embedded-card-payment-gateway.php:192
    8388msgid "Order number prefix"
    8489msgstr ""
    8590
    86 #: visma-pay-embedded-card-payment-gateway.php:190
     91#: visma-pay-embedded-card-payment-gateway.php:194
    8792msgid "Prefix to avoid order number duplication"
    8893msgstr ""
    8994
    90 #: visma-pay-embedded-card-payment-gateway.php:194
     95#: visma-pay-embedded-card-payment-gateway.php:198
    9196msgid "Send products"
    9297msgstr ""
    9398
    94 #: visma-pay-embedded-card-payment-gateway.php:196
     99#: visma-pay-embedded-card-payment-gateway.php:200
    95100msgid "Send product breakdown to Visma Pay (Embedded Card)."
    96101msgstr ""
    97102
    98 #: visma-pay-embedded-card-payment-gateway.php:200
     103#: visma-pay-embedded-card-payment-gateway.php:204
    99104msgid "Send payment confirmation"
    100105msgstr ""
    101106
    102 #: visma-pay-embedded-card-payment-gateway.php:202
     107#: visma-pay-embedded-card-payment-gateway.php:206
    103108msgid "Send Visma Pay (Embedded Card)'s payment confirmation email to the customer's billing e-mail."
    104109msgstr ""
    105110
    106 #: visma-pay-embedded-card-payment-gateway.php:206
     111#: visma-pay-embedded-card-payment-gateway.php:210
    107112msgid "Only allow payments in EUR"
    108113msgstr ""
    109114
    110 #: visma-pay-embedded-card-payment-gateway.php:208
     115#: visma-pay-embedded-card-payment-gateway.php:212
    111116msgid "Enable this option if you want to allow payments only in EUR."
    112117msgstr ""
    113118
    114 #: visma-pay-embedded-card-payment-gateway.php:212
     119#: visma-pay-embedded-card-payment-gateway.php:216
     120msgid "Allow free trial"
     121msgstr ""
     122
     123#: visma-pay-embedded-card-payment-gateway.php:218
     124msgid "Enable to allow using free trial on WC Subscription products"
     125msgstr ""
     126
     127#: visma-pay-embedded-card-payment-gateway.php:219
     128msgid "When this option is enabled, the plugin will create an authorization of 100 fractional monetary units. The currency depends on your store's settings. The authorization is required to save the payment card. After the order is completed, the authorization will be automatically canceled. For example, when using EUR, the authorization will be 1.00 EUR."
     129msgstr ""
     130
     131#: visma-pay-embedded-card-payment-gateway.php:223
    115132msgid "Cancel Page"
    116133msgstr ""
    117134
    118 #: visma-pay-embedded-card-payment-gateway.php:215
     135#: visma-pay-embedded-card-payment-gateway.php:226
    119136msgid "Choose the page where the customer is redirected after a canceled/failed payment."
    120137msgstr ""
    121138
    122 #: visma-pay-embedded-card-payment-gateway.php:216
     139#: visma-pay-embedded-card-payment-gateway.php:227
    123140msgid "Order Received: Shows the customer information about their order and a notice that the payment failed. Customer has an opportunity to try payment again."
    124141msgstr ""
    125142
    126 #: visma-pay-embedded-card-payment-gateway.php:217
     143#: visma-pay-embedded-card-payment-gateway.php:228
    127144msgid "Pay for Order: Returns user to a page where they can try to pay their unpaid order again. "
    128145msgstr ""
    129146
    130 #: visma-pay-embedded-card-payment-gateway.php:218
     147#: visma-pay-embedded-card-payment-gateway.php:229
    131148msgid "Cart: Customer is redirected back to the shopping cart."
    132149msgstr ""
    133150
    134 #: visma-pay-embedded-card-payment-gateway.php:219
     151#: visma-pay-embedded-card-payment-gateway.php:230
    135152msgid "Checkout: Customer is redirected back to the checkout."
    136153msgstr ""
    137154
    138 #: visma-pay-embedded-card-payment-gateway.php:220
     155#: visma-pay-embedded-card-payment-gateway.php:231
    139156msgid "(When using Cart or Checkout as the return page for failed orders, the customer's cart will not be emptied during checkout.)"
    140157msgstr ""
    141158
    142 #: visma-pay-embedded-card-payment-gateway.php:223
     159#: visma-pay-embedded-card-payment-gateway.php:234
    143160msgid "Order Received"
    144161msgstr ""
    145162
    146 #: visma-pay-embedded-card-payment-gateway.php:224
     163#: visma-pay-embedded-card-payment-gateway.php:235
    147164msgid "Pay for Order"
    148165msgstr ""
    149166
    150 #: visma-pay-embedded-card-payment-gateway.php:225
     167#: visma-pay-embedded-card-payment-gateway.php:236
    151168msgid "Cart"
    152169msgstr ""
    153170
    154 #: visma-pay-embedded-card-payment-gateway.php:226
     171#: visma-pay-embedded-card-payment-gateway.php:237
    155172msgid "Checkout"
    156173msgstr ""
    157174
    158 #: visma-pay-embedded-card-payment-gateway.php:230
     175#: visma-pay-embedded-card-payment-gateway.php:241
    159176msgid "Display card logos"
    160177msgstr ""
    161178
    162 #: visma-pay-embedded-card-payment-gateway.php:235
     179#: visma-pay-embedded-card-payment-gateway.php:246
    163180msgid "Visa"
    164181msgstr ""
    165182
    166 #: visma-pay-embedded-card-payment-gateway.php:237
     183#: visma-pay-embedded-card-payment-gateway.php:248
    167184msgid "Display Visa and Verified by Visa logo below the form."
    168185msgstr ""
    169186
    170 #: visma-pay-embedded-card-payment-gateway.php:241
     187#: visma-pay-embedded-card-payment-gateway.php:252
    171188msgid "Mastercard"
    172189msgstr ""
    173190
    174 #: visma-pay-embedded-card-payment-gateway.php:243
     191#: visma-pay-embedded-card-payment-gateway.php:254
    175192msgid "Display Mastercard and Mastercard SecureCode logo below the form."
    176193msgstr ""
    177194
    178 #: visma-pay-embedded-card-payment-gateway.php:247
     195#: visma-pay-embedded-card-payment-gateway.php:258
    179196msgid "American Express"
    180197msgstr ""
    181198
    182 #: visma-pay-embedded-card-payment-gateway.php:249
     199#: visma-pay-embedded-card-payment-gateway.php:260
    183200msgid "Display American Express logo below the form."
    184201msgstr ""
    185202
    186 #: visma-pay-embedded-card-payment-gateway.php:253
     203#: visma-pay-embedded-card-payment-gateway.php:264
    187204msgid "Diners Club"
    188205msgstr ""
    189206
    190 #: visma-pay-embedded-card-payment-gateway.php:255
     207#: visma-pay-embedded-card-payment-gateway.php:266
    191208msgid "Display Diners Club logo below the form."
    192209msgstr ""
    193210
    194 #: visma-pay-embedded-card-payment-gateway.php:274
     211#: visma-pay-embedded-card-payment-gateway.php:286
    195212#: build/blocks.js:1
    196213msgid "Payment card"
    197214msgstr ""
    198215
    199 #: visma-pay-embedded-card-payment-gateway.php:416
    200 #: visma-pay-embedded-card-payment-gateway.php:417
    201 #: visma-pay-embedded-card-payment-gateway.php:432
     216#: visma-pay-embedded-card-payment-gateway.php:293
     217#: build/blocks.js:1
     218msgid "An authorization of 1 %s will be made on your card to save your card details. The authorization will be automatically cancelled after the order has been accepted."
     219msgstr ""
     220
     221#: visma-pay-embedded-card-payment-gateway.php:383
     222msgid "Visma Pay (Embedded Card): Creating a temporary authorization to save card token."
     223msgstr ""
     224
     225#: visma-pay-embedded-card-payment-gateway.php:448
     226#: visma-pay-embedded-card-payment-gateway.php:449
     227#: visma-pay-embedded-card-payment-gateway.php:464
    202228msgid "Visma Pay: No payment methods available for the currency: "
    203229msgstr ""
    204230
    205 #: visma-pay-embedded-card-payment-gateway.php:430
     231#: visma-pay-embedded-card-payment-gateway.php:462
    206232msgid "Visma Pay: \"Only allow payments in EUR\" is enabled and currency was not EUR for order: "
    207233msgstr ""
    208234
    209 #: visma-pay-embedded-card-payment-gateway.php:443
     235#: visma-pay-embedded-card-payment-gateway.php:475
     236#: visma-pay-embedded-card-payment-gateway.php:638
     237#: visma-pay-embedded-card-payment-gateway.php:640
     238msgid "Visma Pay (Embedded Card) order"
     239msgstr ""
     240
     241#: visma-pay-embedded-card-payment-gateway.php:475
     242msgid "Payment pending. Waiting for result."
     243msgstr ""
     244
     245#: visma-pay-embedded-card-payment-gateway.php:497
     246msgid "Visma Pay (Embedded Card) system is currently in maintenance. Please try again in a few minutes."
     247msgstr ""
     248
     249#: visma-pay-embedded-card-payment-gateway.php:503
     250#: visma-pay-embedded-card-payment-gateway.php:517
     251msgid "Payment failed due to an error."
     252msgstr ""
     253
     254#: visma-pay-embedded-card-payment-gateway.php:604
     255msgid "Payment method: Card payment"
     256msgstr ""
     257
    210258#: visma-pay-embedded-card-payment-gateway.php:605
    211 #: visma-pay-embedded-card-payment-gateway.php:607
    212 msgid "Visma Pay (Embedded Card) order"
    213 msgstr ""
    214 
    215 #: visma-pay-embedded-card-payment-gateway.php:443
    216 msgid "Payment pending. Waiting for result."
    217 msgstr ""
    218 
    219 #: visma-pay-embedded-card-payment-gateway.php:465
    220 msgid "Visma Pay (Embedded Card) system is currently in maintenance. Please try again in a few minutes."
    221 msgstr ""
    222 
    223 #: visma-pay-embedded-card-payment-gateway.php:471
    224 #: visma-pay-embedded-card-payment-gateway.php:485
    225 msgid "Payment failed due to an error."
    226 msgstr ""
    227 
    228 #: visma-pay-embedded-card-payment-gateway.php:573
    229 msgid "Payment method: Card payment"
    230 msgstr ""
    231 
    232 #: visma-pay-embedded-card-payment-gateway.php:574
    233259msgid "Card payment info: "
    234260msgstr ""
    235261
    236 #: visma-pay-embedded-card-payment-gateway.php:579
     262#: visma-pay-embedded-card-payment-gateway.php:610
    237263msgid "Verified: "
    238264msgstr ""
    239265
    240 #: visma-pay-embedded-card-payment-gateway.php:582
     266#: visma-pay-embedded-card-payment-gateway.php:613
    241267msgid "Card country: "
    242268msgstr ""
    243269
    244 #: visma-pay-embedded-card-payment-gateway.php:583
     270#: visma-pay-embedded-card-payment-gateway.php:614
    245271msgid "Client IP country: "
    246272msgstr ""
    247273
    248 #: visma-pay-embedded-card-payment-gateway.php:588
     274#: visma-pay-embedded-card-payment-gateway.php:619
    249275msgid "Error: "
    250276msgstr ""
    251277
    252 #: visma-pay-embedded-card-payment-gateway.php:593
     278#: visma-pay-embedded-card-payment-gateway.php:624
    253279msgid "Payment method: "
    254280msgstr ""
    255281
    256 #: visma-pay-embedded-card-payment-gateway.php:605
    257 #: visma-pay-embedded-card-payment-gateway.php:894
     282#: visma-pay-embedded-card-payment-gateway.php:638
     283#: visma-pay-embedded-card-payment-gateway.php:957
    258284msgid "Payment is authorized. Use settle option to capture funds."
    259285msgstr ""
    260286
    261 #: visma-pay-embedded-card-payment-gateway.php:607
    262 #: visma-pay-embedded-card-payment-gateway.php:898
     287#: visma-pay-embedded-card-payment-gateway.php:640
     288#: visma-pay-embedded-card-payment-gateway.php:961
    263289msgid "Payment accepted."
    264290msgstr ""
    265291
    266 #: visma-pay-embedded-card-payment-gateway.php:618
     292#: visma-pay-embedded-card-payment-gateway.php:651
    267293msgid "Card token: "
    268294msgstr ""
    269295
    270 #: visma-pay-embedded-card-payment-gateway.php:619
     296#: visma-pay-embedded-card-payment-gateway.php:652
    271297msgid "Expiration: "
    272298msgstr ""
    273299
    274 #: visma-pay-embedded-card-payment-gateway.php:645
     300#: visma-pay-embedded-card-payment-gateway.php:679
     301msgid "Visma Pay (Embedded Card): Succesfully cancelled temporary authorization."
     302msgstr ""
     303
     304#: visma-pay-embedded-card-payment-gateway.php:686
     305msgid "Visma Pay (Embedded Card): Failed to cancel temporary authorization. You should cancel the authorization using Visma Pay merchant portal."
     306msgstr ""
     307
     308#: visma-pay-embedded-card-payment-gateway.php:708
    275309msgid "Payment was not accepted."
    276310msgstr ""
    277311
    278 #: visma-pay-embedded-card-payment-gateway.php:653
     312#: visma-pay-embedded-card-payment-gateway.php:716
    279313msgid "Transaction status could not be updated after customer returned from the web page of a bank. Please use the merchant UI to resolve the payment status."
    280314msgstr ""
    281315
    282 #: visma-pay-embedded-card-payment-gateway.php:661
     316#: visma-pay-embedded-card-payment-gateway.php:724
    283317msgid "Maintenance break. The transaction is not created and the user has been notified and transferred back to the cancel address."
    284318msgstr ""
    285319
    286 #: visma-pay-embedded-card-payment-gateway.php:691
     320#: visma-pay-embedded-card-payment-gateway.php:754
    287321msgid "Card payment failed. Your card has not been charged."
    288322msgstr ""
    289323
    290 #: visma-pay-embedded-card-payment-gateway.php:693
     324#: visma-pay-embedded-card-payment-gateway.php:756
    291325msgid "Payment was canceled or charge was not accepted."
    292326msgstr ""
    293327
    294 #: visma-pay-embedded-card-payment-gateway.php:722
     328#: visma-pay-embedded-card-payment-gateway.php:785
    295329msgid "The card is reported lost or stolen."
    296330msgstr ""
    297331
    298 #: visma-pay-embedded-card-payment-gateway.php:724
     332#: visma-pay-embedded-card-payment-gateway.php:787
    299333msgid "General decline. The card holder should contact the issuer to find out why the payment failed."
    300334msgstr ""
    301335
    302 #: visma-pay-embedded-card-payment-gateway.php:726
     336#: visma-pay-embedded-card-payment-gateway.php:789
    303337msgid "Insufficient funds. The card holder should verify that there is balance on the account and the online payments are actived."
    304338msgstr ""
    305339
    306 #: visma-pay-embedded-card-payment-gateway.php:728
     340#: visma-pay-embedded-card-payment-gateway.php:791
    307341msgid "Expired card."
    308342msgstr ""
    309343
    310 #: visma-pay-embedded-card-payment-gateway.php:730
     344#: visma-pay-embedded-card-payment-gateway.php:793
    311345msgid "Withdrawal amount limit exceeded."
    312346msgstr ""
    313347
    314 #: visma-pay-embedded-card-payment-gateway.php:732
     348#: visma-pay-embedded-card-payment-gateway.php:795
    315349msgid "Restricted card. The card holder should verify that the online payments are actived."
    316350msgstr ""
    317351
    318 #: visma-pay-embedded-card-payment-gateway.php:734
     352#: visma-pay-embedded-card-payment-gateway.php:797
    319353msgid "Timeout communicating with the acquirer. The payment should be tried again later."
    320354msgstr ""
    321355
    322 #: visma-pay-embedded-card-payment-gateway.php:745
     356#: visma-pay-embedded-card-payment-gateway.php:808
    323357msgid "3-D Secure was used."
    324358msgstr ""
    325359
    326 #: visma-pay-embedded-card-payment-gateway.php:747
     360#: visma-pay-embedded-card-payment-gateway.php:810
    327361msgid "3-D Secure was not used."
    328362msgstr ""
    329363
    330 #: visma-pay-embedded-card-payment-gateway.php:749
     364#: visma-pay-embedded-card-payment-gateway.php:812
    331365msgid "3-D Secure was attempted but not supported by the card issuer or the card holder is not participating."
    332366msgstr ""
    333367
    334 #: visma-pay-embedded-card-payment-gateway.php:774
     368#: visma-pay-embedded-card-payment-gateway.php:837
    335369msgid "Payment settled."
    336370msgstr ""
    337371
    338 #: visma-pay-embedded-card-payment-gateway.php:792
     372#: visma-pay-embedded-card-payment-gateway.php:855
    339373msgid "Settle payment"
    340374msgstr ""
    341375
    342 #: visma-pay-embedded-card-payment-gateway.php:816
     376#: visma-pay-embedded-card-payment-gateway.php:879
    343377msgid "Settlement was successful."
    344378msgstr ""
    345379
    346 #: visma-pay-embedded-card-payment-gateway.php:819
     380#: visma-pay-embedded-card-payment-gateway.php:882
    347381msgid "Settlement failed. Validation failed."
    348382msgstr ""
    349383
    350 #: visma-pay-embedded-card-payment-gateway.php:822
     384#: visma-pay-embedded-card-payment-gateway.php:885
    351385msgid "Settlement failed. Either the payment has already been settled or the payment gateway refused to settle payment for given transaction."
    352386msgstr ""
    353387
    354 #: visma-pay-embedded-card-payment-gateway.php:825
     388#: visma-pay-embedded-card-payment-gateway.php:888
    355389msgid "Settlement failed. Unknown error."
    356390msgstr ""
    357391
    358 #: visma-pay-embedded-card-payment-gateway.php:832
     392#: visma-pay-embedded-card-payment-gateway.php:895
    359393msgid "Exception, error: "
    360394msgstr ""
    361395
    362 #: visma-pay-embedded-card-payment-gateway.php:894
    363 #: visma-pay-embedded-card-payment-gateway.php:898
     396#: visma-pay-embedded-card-payment-gateway.php:957
     397#: visma-pay-embedded-card-payment-gateway.php:961
    364398msgid "Visma Pay (Embedded Card, Subscription) order"
    365399msgstr ""
    366400
    367 #: visma-pay-embedded-card-payment-gateway.php:907
     401#: visma-pay-embedded-card-payment-gateway.php:970
    368402msgid "Duplicate order number."
    369403msgstr ""
    370404
    371 #: visma-pay-embedded-card-payment-gateway.php:911
     405#: visma-pay-embedded-card-payment-gateway.php:974
    372406msgid "Card token not found."
    373407msgstr ""
    374408
    375 #: visma-pay-embedded-card-payment-gateway.php:936
     409#: visma-pay-embedded-card-payment-gateway.php:999
    376410msgid "Payment failed. The card was not charged. Error: "
    377411msgstr ""
    378412
    379 #: visma-pay-embedded-card-payment-gateway.php:936
     413#: visma-pay-embedded-card-payment-gateway.php:999
    380414msgid "Payment failed. The card was not charged."
    381415msgstr ""
    382416
    383 #: visma-pay-embedded-card-payment-gateway.php:945
     417#: visma-pay-embedded-card-payment-gateway.php:1008
    384418msgid "Payment failed. Exception: "
    385419msgstr ""
    386420
    387 #: visma-pay-embedded-card-payment-gateway.php:983
     421#: visma-pay-embedded-card-payment-gateway.php:1046
    388422msgid "Failed to delete the card token %s. Return code: %s"
    389423msgstr ""
    390424
    391 #: visma-pay-embedded-card-payment-gateway.php:988
     425#: visma-pay-embedded-card-payment-gateway.php:1051
    392426msgid "Failed to delete the card token %s. Exception: %s"
    393427msgstr ""
  • visma-pay-embedded-card-payment-gateway/trunk/readme.txt

    r3149117 r3253989  
    44Tags: payment gateway, visma, pay, verkkomaksut, korttimaksut, vismapay
    55Requires at least: 3.3
    6 Tested up to: 6.6.1
     6Tested up to: 6.7.2
    77Stable tag: trunk
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010WC requires at least: 3.0.0
    11 WC tested up to: 9.1.4
     11WC tested up to: 9.7.1
    1212
    1313Visma Pay plugin for Woocommerce.
     
    4141
    4242== Changelog ==
     43
     44= 1.1.6 =
     45* Added support for free trial on subscription products
     46* Updated 'tested up to' versions.
    4347
    4448= 1.1.5 =
  • visma-pay-embedded-card-payment-gateway/trunk/visma-pay-embedded-card-payment-gateway.php

    r3149117 r3253989  
    44 * Plugin URI: https://www.vismapay.com/docs
    55 * Description: Visma Pay Payment Gateway Embedded Card Integration for Woocommerce
    6  * Version: 1.1.5
     6 * Version: 1.1.6
    77 * Author: Visma
    88 * Author URI: https://www.visma.fi/vismapay/
     
    1010 * Domain Path: /languages
    1111 * WC requires at least: 3.0.0
    12  * WC tested up to: 9.1.4
     12 * WC tested up to: 9.7.1
    1313 */
    1414
     
    5757    class WC_Gateway_visma_pay_embedded_card extends WC_Payment_Gateway
    5858    {
     59        const VP_FREE_TRIAL_AMOUNT = 100;
     60
    5961        protected $api_key;
    6062        protected $private_key;
    6163        protected $ordernumber_prefix;
    6264        protected $send_items;
     65        protected $allow_free_trial;
    6366        protected $send_receipt;
    6467        protected $cancel_url;
     
    104107            $this->send_items = $this->get_option('send_items');
    105108            $this->send_receipt = $this->get_option('send_receipt');
     109            $this->allow_free_trial = $this->get_option('allow_free_trial');
    106110
    107111            $this->cancel_url = $this->get_option('cancel_url');
     
    209213                    'default' => 'yes',
    210214                ),
     215                'allow_free_trial' => array(
     216                    'title' => __( 'Allow free trial', 'visma-pay-embedded-card-payment-gateway' ),
     217                    'type' => 'checkbox',
     218                    'label' => __( 'Enable to allow using free trial on WC Subscription products', 'visma-pay-embedded-card-payment-gateway' ),
     219                    'description' => __( 'When this option is enabled, the plugin will create an authorization of 100 fractional monetary units. The currency depends on your store\'s settings. The authorization is required to save the payment card. After the order is completed, the authorization will be automatically canceled. For example, when using EUR, the authorization will be 1.00 EUR.', 'visma-pay-embedded-card-payment-gateway' ),
     220                    'default' => 'no'
     221                ),
    211222                'cancel_url' => array(
    212223                    'title' => __( 'Cancel Page', 'visma-pay-embedded-card-payment-gateway' ),
     
    263274            if(!(is_checkout() || $this->is_available()))
    264275                return;
     276
    265277            wp_enqueue_style( 'woocommerce_visma_pay_embedded_card', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) . '/assets/css/vismapay-embedded.css', '', '', 'all');
    266278            wp_enqueue_script( 'woocommerce_visma_pay_embedded_card', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) . '/assets/js/vismapay-embedded.js', array( 'jquery' ), '', true );
     
    272284            $clear_both = '<div style="display: block; clear: both;"></div>';
    273285
    274             echo '<div id="visma-pay-embedded-card-payment-content">'.wpautop(wptexturize(__( 'Payment card', 'visma-pay-embedded-card-payment-gateway' ))) . "<div id='pf-cc-form'><iframe frameBorder='0' scrolling='no' id='pf-cc-iframe' class='intrinsic-ignore' height='220px' style='width:100%' src='https://www.vismapay.com/e-payments/embedded_card_form?lang=".$this->get_lang()."'></iframe></div>" . $clear_both;
     286            echo '<div id="visma-pay-embedded-card-payment-content">'.wpautop(wptexturize(esc_html__( 'Payment card', 'visma-pay-embedded-card-payment-gateway' )));
     287
     288           
     289            if($this->visma_pay_cart_has_free_trial())
     290            {
     291                $currency = get_woocommerce_currency();
     292
     293                echo '<div class="woocommerce-info">' . sprintf(esc_html__('An authorization of 1 %s will be made on your card to save your card details. The authorization will be automatically cancelled after the order has been accepted.', 'visma-pay-embedded-card-payment-gateway'), $currency) . '</div>';
     294            }
     295               
     296            echo "<div id='pf-cc-form'><iframe frameBorder='0' scrolling='no' id='pf-cc-iframe' class='intrinsic-ignore' height='220px' style='width:100%' src='https://www.vismapay.com/e-payments/embedded_card_form?lang=".$this->get_lang()."'></iframe></div>" . $clear_both;
    275297
    276298            if($this->visa_logo === 'yes' || $this->mc_logo === 'yes' || $this->amex_logo === 'yes' || $this->diners_logo === 'yes')
     
    325347
    326348            $order = new WC_Order($order_id);
    327             $wc_order_id = $order->get_id();
    328349            $wc_order_total = $order->get_total();
    329350
     
    335356            $return_url = add_query_arg( array('wc-api' => get_class( $this ) ,'order_id' => $order_id), $redirect_url );
    336357
    337             $amount =  (int)(round($wc_order_total*100, 0));
     358            $amount = (int)(round($wc_order_total*100, 0));
     359            $override_auto_settlement = 0;
     360            $register_card_token = 0;
    338361
    339362            $order->update_meta_data('visma_pay_embedded_card_is_settled', 99);
    340363            $order->update_meta_data('visma_pay_embedded_card_return_code', 99);
     364            $order->update_meta_data('visma_pay_embedded_card_return_code', 99);
     365            $order->update_meta_data('_visma_pay_embedded_card_only_save_token', 0);
    341366            $order->save();
    342367
     
    349374            else
    350375                $receipt_mail = '';
     376
     377            if($this->visma_pay_order_related_to_subscription($order))
     378            {
     379                $register_card_token =  1;
     380
     381                if($this->visma_pay_only_authorize($order))
     382                {
     383                    $order->add_order_note(__('Visma Pay (Embedded Card): Creating a temporary authorization to save card token.', 'visma-pay-embedded-card-payment-gateway'));
     384                    $order->update_meta_data('_visma_pay_embedded_card_only_save_token', 1);
     385                    $order->save();
     386
     387                    $override_auto_settlement = 1;
     388                    $amount = self::VP_FREE_TRIAL_AMOUNT;
     389                    $receipt_mail = '';
     390                }
     391            }
    351392
    352393            $payment->addCharge(
     
    366407            }
    367408
    368             $register_card_token = 0;
    369 
    370             if(function_exists('wcs_order_contains_subscription'))
    371             {
    372                 if(wcs_order_contains_subscription($order) || wcs_order_contains_renewal($order) || wcs_is_subscription($order))
    373                 {
    374                     $register_card_token =  1;
    375                 }
    376             }
    377 
    378409            $payment->addPaymentMethod(
    379410                array(
     
    383414                    'lang' => $lang,
    384415                    'token_valid_until' => strtotime('+1 hour'),
    385                     'register_card_token' => $register_card_token
     416                    'register_card_token' => $register_card_token,
     417                    'override_auto_settlement' => $override_auto_settlement,
    386418                )
    387419            );
     
    554586                    $this->visma_pay_embedded_die("Order not found.");
    555587
    556                 $wc_order_id = $order->get_id();
    557588                $wc_order_status = $order->get_status();
    558589
     
    602633                        {
    603634                            case 0:
    604                                 if($settled == 0)
     635                                $should_cancel = $order->get_meta('_visma_pay_embedded_card_only_save_token', true, 'edit');
     636
     637                                if($settled == 0 && $should_cancel == 0)
    605638                                    $pbw_note = __('Visma Pay (Embedded Card) order', 'visma-pay-embedded-card-payment-gateway') . ' ' . $order_number . "<br>-<br>" . __('Payment is authorized. Use settle option to capture funds.', 'visma-pay-embedded-card-payment-gateway') . "<br>";
    606639                                else
     
    633666                                            $subscription->add_order_note($pbw_note . $pbw_extra_info);
    634667                                            $subscription->save();
     668                                        }
     669
     670                                        $wc_order_total = $order->get_total();
     671                                        $amount = (int)(round($wc_order_total*100, 0));
     672
     673                                        if($should_cancel == 1 && $amount === 0)
     674                                        {
     675                                            $cancel_result = $payment->cancelPayment($order_number);
     676
     677                                            if($cancel_result->result == 0)
     678                                            {
     679                                                $order->add_order_note(__(
     680                                                    'Visma Pay (Embedded Card): Succesfully cancelled temporary authorization.',
     681                                                    'visma-pay-embedded-card-payment-gateway'
     682                                                ));
     683                                            }
     684                                            else
     685                                            {
     686                                                $order->add_order_note(__(
     687                                                    'Visma Pay (Embedded Card): Failed to cancel temporary authorization. You should cancel the authorization using Visma Pay merchant portal.',
     688                                                    'visma-pay-embedded-card-payment-gateway'
     689                                                ));
     690                                               
     691                                                $this->logger->error(
     692                                                    'Visma Pay Embedded - Failed to cancel temporary authorization. You should cancel the authorization using Visma Pay merchant portal. Order: ' . $order->id,
     693                                                     $this->logcontext
     694                                                );
     695                                            }
     696
     697                                            $order->update_meta_data('visma_pay_embedded_card_is_settled', 1);
    635698                                        }
    636699                                    }
     
    9921055        protected function add_products_to_payment($payment, $order, $amount)
    9931056        {
     1057            $only_tokenize = $order->get_meta('_visma_pay_embedded_card_only_save_token', true, 'edit');
     1058
     1059            if($only_tokenize == 1)
     1060            {
     1061                return $this->visma_pay_add_dummy_product_to_payment($payment);
     1062            }
     1063
    9941064            $products = array();
    9951065            $total_amount = 0;
     
    11381208            return $actions;
    11391209        }
     1210
     1211        protected function visma_pay_order_has_free_trial($order)
     1212        {
     1213            $subscriptions = wcs_get_subscriptions_for_order($order);
     1214
     1215            foreach ($subscriptions as $subscription)
     1216            {
     1217
     1218                $trial_length = wcs_estimate_periods_between(
     1219                    $subscription->get_time('start'),
     1220                    $subscription->get_time('trial_end'),
     1221                    $subscription->get_trial_period()
     1222                );
     1223
     1224                if ($trial_length > 0)
     1225                    return true;
     1226            }
     1227
     1228            return false;
     1229        }
     1230
     1231        protected function visma_pay_only_authorize($order)
     1232        {
     1233            $wc_order_total = $order->get_total();
     1234            $amount = (int)(round($wc_order_total*100, 0));
     1235
     1236            $has_free_trial = $this->visma_pay_order_has_free_trial($order);
     1237
     1238            if($this->allow_free_trial == 'yes' && $amount === 0 && $has_free_trial)
     1239            {
     1240                return true;
     1241            }
     1242
     1243            return false;
     1244        }
     1245
     1246        protected function visma_pay_add_dummy_product_to_payment($payment)
     1247        {
     1248            $payment->addProduct(
     1249                array(
     1250                    'id' => '1',
     1251                    'title' => 'register_card_token',
     1252                    'count' => 1,
     1253                    'pretax_price' => self::VP_FREE_TRIAL_AMOUNT,
     1254                    'tax' => 0,
     1255                    'price' => self::VP_FREE_TRIAL_AMOUNT,
     1256                    'type' => 1,
     1257                )
     1258            );
     1259
     1260            return $payment;
     1261        }
     1262
     1263        protected function visma_pay_order_related_to_subscription($order)
     1264        {
     1265            if (!function_exists('wcs_order_contains_subscription'))
     1266                return false;
     1267       
     1268            $contains_subs = wcs_order_contains_subscription($order);
     1269            $contains_renew = wcs_order_contains_renewal($order);
     1270            $is_subs = wcs_is_subscription($order);
     1271       
     1272            if ($contains_subs || $contains_renew || $is_subs)
     1273                return true;
     1274
     1275            return false;
     1276        }
     1277
     1278        // Called from WC_Gateway_Visma_Pay_Blocks_Support
     1279        function visma_pay_cart_has_free_trial()
     1280        {
     1281            $cart = WC()->cart;
     1282
     1283            if (!$cart || $this->allow_free_trial != 'yes' || !class_exists('WC_Subscriptions_Product'))
     1284                return false;
     1285
     1286            $wc_cart_total = WC()->cart->total;
     1287            $cart_total = (int)(round($wc_cart_total*100, 0));
     1288           
     1289            foreach ($cart->get_cart() as $cart_item)
     1290            {
     1291                $product_id = $cart_item['product_id'];
     1292                $trial_length = WC_Subscriptions_Product::get_trial_length($product_id);
     1293
     1294                if ($trial_length > 0 && $cart_total === 0)
     1295                    return true;
     1296            }
     1297
     1298            return false;
     1299        }
    11401300    }
    11411301}
Note: See TracChangeset for help on using the changeset viewer.