Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a...

34
VERIFIED PARTNER STRIPE PAYMENTS - MAGENTO 1 - DOCUMENTATION 1. About 2. Installation a. Recommended Method b. Manual Installation c. Uninstalling d. Upgrading 3. Configuration 4. Testing Cards 5. Stripe Webhooks Configuration 6. How to test Stripe Webhooks offline (in development) 7. Configure Apple Pay, Google Pay and Microsoft 8. Saved Cards 9. Issuing Refunds 10. Capturing «Authorized Only» payments 11. Capturing telephone orders from the admin area 12. Enabling fraud prevention features (Stripe Radar) 13. 3D Secure v2 / Dynamic 3D Secure 14. How to style the payment form 15. Translations for multi-language websites 16. Troubleshooting i. Enable Error Logging ii. Front-End Crash (Website does not load) iii. Missing required param: number. iv. Order stuck in Pending status v. Unable to use Stripe.js vi. Verify that Stripe.js is enabled vii. Continue to Next Step button does not work (stuck spinner) viii. Continue to Next Step button redirects to the shopping cart ix. You cannot confirm this PaymentIntent because it has a status of succeeded x. Tracking down conflicts with other modules xi. Broken Admin Area xii. Stripe no longer supports API requests made with TLS 1.0. xiii. Failed/Partial/Corrupted Installations xiv. The CSS/styling of the payment form is broken 17. Thanks

Transcript of Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a...

Page 1: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

VERIFIED PARTNER

STRIPE PAYMENTS - MAGENTO 1 - DOCUMENTATION

1. About2. Installation

a. Recommended Methodb. Manual Installationc. Uninstallingd. Upgrading

3. Configuration4. Testing Cards5. Stripe Webhooks Configuration6. How to test Stripe Webhooks offline (in development)7. Configure Apple Pay, Google Pay and Microsoft8. Saved Cards9. Issuing Refunds

10. Capturing «Authorized Only» payments11. Capturing telephone orders from the admin area12. Enabling fraud prevention features (Stripe Radar)13. 3D Secure v2 / Dynamic 3D Secure14. How to style the payment form15. Translations for multi-language websites16. Troubleshooting

i. Enable Error Loggingii. Front-End Crash (Website does not load)

iii. Missing required param: number.iv. Order stuck in Pending statusv. Unable to use Stripe.js

vi. Verify that Stripe.js is enabledvii. Continue to Next Step button does not work (stuck spinner)

viii. Continue to Next Step button redirects to the shopping cartix. You cannot confirm this PaymentIntent because it has a status of succeededx. Tracking down conflicts with other modules

xi. Broken Admin Areaxii. Stripe no longer supports API requests made with TLS 1.0.

xiii. Failed/Partial/Corrupted Installationsxiv. The CSS/styling of the payment form is broken

17. Thanks

Page 2: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

ABOUTStripe Payments is a module for Magento 1 which allows merchants to accept payments using the Stripepayment gateway. This is the documentation for installing, configuring and using Stripe Payments onMagento 1.

INSTALLATIONWarning! We recommend that you test the module on a testing server before installing it on your liveweb server. Please see the Troubleshooting section if you come across any installation issue.

Recommended Method

1. If you haven't done so already, please download the module from your customer account section orthrough the email that was sent to you when you purchased the module.

2. Log into your website's magento admin section.3. Make sure that compilation is disabled from System > Tools > Compilation.4. Go to System > Magento Connect > Magento Connect Manager and log in.5. If you have been evaluating any other Stripe modules not developed by Cryozonic, please uninstall

them now to avoid obscure conflicts between the modules.6. Under «Direct package file upload», upload the .tgz file that you downloaded from our website.7. Click the «Install» button when the module has uploaded successfully.8. Check the black console to make sure that there were no errors.9. If you had compilation enabled, recompile from System > Tools > Compilation.

10. Under System > Cache Management, flush all of your caches, including Merged CSS/JS if those areenabled

11. Proceed to Stripe Webhooks Configuration in your Stripe dashboard.

Manual Installation

If for any reason the above procedure did not work (usually because the web server has no writepermissions in your Magento directory), then you can install the module manually by simply extractingthe module in your Magento's root directory.

1. Double click the .tgz file to uncompress it. If you are on a version of Windows that does not supportthis, we recommend using the 7-Zip file archiver to uncompress the module.

2. Upload the extracted files by FTP to your website, inside your website's root Magento directory. Ifyou do not have an FTP client already, you can use FileZilla.

3. A single page refresh of your website will set up the module and its database dependencies.4. Flush your site's caches, merged CSS and Javascript, and re-run compilation if necessary.5. Proceed to Stripe Webhooks Configuration in your Stripe dashboard.

Page 3: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

Uninstalling

If you have installed the module from Magento Connect Manager, it should be just as simple touninstall through the same interface as shown in the following screenshot:

If you have installed the module manually, you will need to manually delete each file and directorylisted in the Failed/Partial/Corrupted Installations section.

Upgrading

Important: If you have Stripe Subscriptions installed as well, always upgrade both modules to theirlatest version.

You can always download the latest version of the module from your account. Once you have the latestversion:

1. If you have installed the module through Magento Connect Manager: Simply uninstall and re-install the module using the same instructions as above.

2. If you have installed the module manually: Since v3.4.0 of the module, template files have movedto different directories. To uninstall the module, it is necessary to remove old module filesmanually before installing the newer version. If you simply overwrite them, you may run acrosstemplate fallback issues. You should delete all of the old files from disk, but do not drop anydatabase tables as part of the upgrade. Once the files are removed, we always recommend themagento connect manager installation method, otherwise you can re-install using the manualmethod.

CONFIGURATION1. Go to System > Configuration > Payment Methods2. Expand the section «Stripe Payment Gateway» as shown in the following screenshot:

Page 4: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting
Page 5: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

3. Enabled: Change to «Yes»4. You will also need to fill in your test and live keys that Stripe has provided to you when you

created your account. You can get these by logging into Stripe, navigating to your account settingsand clicking on «API Keys»

5. Mode: If you would like to test a payment, leave the mode to «Test». When you are ready to acceptlive transactions, you can change this to «Live». Testing cards are provided in the next section.

6. Security Method: This configuration option sets the method by which card details aretransmitted from the customer's browser to the payment network. There are 3 possible optionshere:

None: The card details are sent directly to your website, where the Stripe API is used totokenize them and charge the customer. Although the card details are not saved on yourwebsite, this is considered an insecure method of handling cardholder details. The reason thisis supported is because it is the most compatible method with heavily customized checkoutpages. If you decide to use this method in production, we recommend that you select a hostingprovider that is also PCI compliant (i.e. that had a vulnerability scan by an «ApprovedScanning Vendor»). Otherwise, you can use this method during development until yourwebsite is stable and you are ready to switch to the javascript-based Stripe.js or StripeElements methods.Stripe.js v2: The card details are sent from the customer's browser directly to Stripe's secureservers where they are tokenized for security. Using this method will both provide increasedsecurity and also enable you to use Apple Pay and Stripe Radar. If you use this method, PCIguidelines require that you validate your PCI compliance annually using SAQ A-EP, instead ofthe simpler SAQ A.Stripe.js v3 + Stripe Elements: This is a new security method from Stripe which isdifferent in that the form fields of the card details are hosted directly on Stripe's servers usingan embedded iframe on your website. Merchants that use this method are eligible for thesimplest PCI validation method: Self-Assessment Questionnaire A (SAQ A). Using this methodwill both provide the strongest security features on your website. For CSS styling of StripeElements, please refer to the section How to style the payment form.

7. Apple Pay: Enabling this feature will display an Apple Pay, Google Pay or Microsoft Pay button at

Page 6: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

the checkout. See this section for details on additional steps necessary to enable this feature.8. Stripe Radar: Enabling Stripe Radar will place orders under manual review if they are marked as

Elevated risk by Stripe. Please see the section Enabling fraud prevention features (Stripe Radar) foradditional details.

9. Payment Action: Select «Authorize and Capture» if you would like the customer cards to becharged immediately after a purchase. This is the default option and it does not require you to doanything else after the customer has placed the order. If you prefer to finalize the payment later,you can choose «Authorize Only» which will lock/authorize the order amount on the customer'scard so that you can capture the amount later by issuing an invoice. More on invoicing later in thisdocument.

10. Expired Authorizations: If you decide to «Authorize Only» your customer's transactions, havein mind that Stripe will expire authorizations after 7 days. Under «Expired Authorizations», youcan decide what to do in the admin area after authorizations have expired. Capturing the amountwill work fine within 7 days but Stripe will give you an error after that. With the Stripe Paymentsmodule, you can configure it to try and re-create the original payment using one of your customer'ssaved cards. If you enable this feature, make sure to also enable the saved cards feature.

11. Automatic Invoicing: If you have "Payment Action" configured to be "Authorize Only", then aninvoice is not normally created because a charge is not created at the checkout. However, if youneed to force generate an invoice at the checkout, either because you need to email it to thecustomer before the charge is created, or because you need the order status to be Processinginstead of Pending, then you can enable this option. Once enabled, an invoice will be created in"Pending" status instead of the normal "Paid" status. Then, after you capture the payment, theinvoice will switch to "Paid" status and the order status will change to "Complete".

12. Save Customer Cards: Enable if you want Amazon-style saved cards on your website, so thatcustomers do not enter their details more than once. This feature does not store cards or cardtokens on your server and is fully PCI compliant. For more details, please see the «Saved Cards»section in this document.

13. Optional Statement Descriptor: If you set a statement descriptor, then when the customer ischarged, this description will appear in their bank statement. You can set different statementdescriptors for each of your store views if you are running more than one store on the same setup.

14. Email Copy of Invoice: At the checkout when an order is placed, Magento will send an orderemail by default. If you need to additionally send an invoice email, then enable this setting. Pleasenote that invoices are created only when the Payment Action is set to Authorize and Capture. Ifit is set to Authorize Only, then invoices must be manually created from the admin area. Thissetting will be ignored in the admin area because admins can email invoices when they create themmanually.

15. Pay in store currency: If you are running a multi-currency / multi-language website, then youcan charge your customers either in the configured base currency or in the foreign currency thatthey see in the checkout. This is enabled by default, but if you have reason to prefer the basecurrency (i.e. some Canadian Stripe accounts have currency restrictions) then you can disable this.

16. New Order Status: This is the order status that will automatically be assigned to each new order.

Page 7: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

17. Enable Stripe email receipts: This setting will force the module to always send the customeremail to Stripe, even for guest customers, which is a requirement if you have Stripe Email Receiptsenabled in your Stripe account. Enabling email receipts will allow you to send customized paymentemails to your customers through Stripe. Deliverability of these emails is higher than manyMagento setups, and can be used without setting up a mailing system on your Magento server.

18. Show Accepted Card Icons: This setting will display and auto-detect the accepted card types atthe checkout page. If you set this to «Show all accepted card types», then you will see a row ofaccepted card icons during checkout:

As the customer types their card number, the correct card type icon will be highlighted.

If you set this to «Show only the detected card type», then the detected card type icon will appearin the Card Number input box:

19. Enable Stripe email receipts: When this option is enabled, the customer email will be sent toStripe API along with every purchase made on your website. The email can be used together withpre-configured Stripe Email Receipts which can be sent to your customer by Stripe's serversinstead of your own. This can be useful if your web server is not configured to send emails, or withsubscription purchases that are billed monthly and you'd like to notify your customers about thepayment. Please note that if you enable Stripe Email Receipts but you forget to enable this option,Stripe may fall back to the customer email for customers that have registered on your website, butit will not work for guest customers as they do not have an email on Stripe's servers.

20. Accepted Card Types: Enables or disables specific card type icons for the checkout page. Youmay want to configure this based on the country of your Stripe account.

Page 8: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

21. Payment Applicable From If you only want to provide this payment option to certain countries,you can optionally change the «Payment Applicable From» to «Specific Countries»

22. Payment From Specific Countries Select the countries for which this payment method shouldappear at the checkout.

23. Sort Order: If you have multiple payment methods enabled, this setting will determine the orderof the Stripe payment method at the checkout page. For example, if you also have PayPal enabledand would like Stripe to appear after PayPal, then set this number to something larger than what isconfigured in the PayPal configuration section.

TESTING CARDSYou can use the following card details to try out the module while configured to be in Test Mode.

To Test Use Card Details

Successful Payment

Name on card: Any

Card number: 4242424242424242

Expiry Date: Must be in the future

CVC: Any 3 digit number

Unsuccessful PaymentSame as a successful payment,

but with card number 4000000000000002

Wrong Expiry DateSame as a successful payment,

but with expiry date in the past

Wrong CVC numberSame as a successful payment,

but with card number 4000000000000101

Expired CardSame as a successful payment,

but with card number 4000000000000069

Wrong Billing Address with enabled

Address Verification System (AVS)

Same as a successful payment,

but with card number 4000000000000010

Processing ErrorSame as a successful payment,

but with card number 4000000000000119

Page 9: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

Warning: If you prefer testing in live mode, make sure to set the payment method to «AuthorizeOnly», otherwise currency conversion fees may be incurred.

You can also find an up to date list of all testing options at https://stripe.com/docs/testing

STRIPE WEBHOOKS CONFIGURATIONWebhooks are an events emission mechanism that allows Stripe to inform your website when apayment event has occurred. They can be used to create Credit Memos or Invoices in Magento when apayment is refunded or captured from your Stripe dashboard. They can also be used to create recurringorders with Stripe Subscriptions, issue invoices for SEPA Direct Debit and other asynchronous paymentmethods like SOFORT. They will change the order status from Pending to Processing when a charge hassucceeded, or to Cancelled when a charge has failed. This is especially important with redirect-basedpayment methods where a customer may close the browser tab and never return to your website afterthey authorize a payment.

Webhooks can be configured in your Stripe Webhooks section. The webhook URL should behttps://www.yourdomain.com/cryozonic_stripe/webhooks and it should be configured tosend all events to your website. Once added, this should look like so:

If you have any webhooks that were configured in the past as part of an older add-on, you shouldremove those webhooks from your Stripe dashboard and only have a single endpoint tohttps://www.yourdomain.com/cryozonic_stripe/webhooks

If you have multiple domain names or multiple store views under the same Magento installation, youwill only need to configure a single webhook endpoint. So for example if the following endpoints areavailable:

https://www.your-domain.com/en_us/cryozonic_stripe/webhookshttps://www.your-uk-domain.co.uk/en_gb/cryozonic_stripe/webhooks

then you can pick any of the two endpoints and configure just that one. The module is smart enough tonotify all modules and add-ons across your Magento installation about the received webhook event.

Page 10: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

HOW TO TEST STRIPE WEBHOOKS OFFLINE (INDEVELOPMENT)If you are working on a development environment that cannot externally accept webhook requests, youcan still test with the following manual method:

1. In your Stripe dashboard, configure the test webhook URL to your live endpoint. If you still don'thave a live server, you can use a http://requestb.in/ endpoint.

2. Place an order with any of the module's payment methods.3. From your Stripe Events section, locate the source.chargeable event for the order you placed:

4. From the event page, scroll to the bottom, expand the webhook request and copy the Request bodyunder the successful webhook request:

Page 11: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

5. Using the Chrome Postman extension, create a POST request tohttp://yourdomain.dev/cryozonic_stripe/webhooks with a request body that is the same as the oneyou copied above.

6. Trigger the request from Postman and check if the order status was updated to Processing underSales > Orders.

CONFIGURE APPLE PAY, GOOGLE PAY AND MICROSOFTWhen Apple Pay is enabled, and your customeris using a device that supports Apple Pay, GooglePay, or Microsoft, then a payment button willappear as shown in the screenshot on the right→

Apple/Google/Microsoft Pay can also be testedon our demo server. Before using them on yourown website, you must first meet the minimumrequirements listed in the checklist below:

Minimum Requirements Checklist

1. Authenticate your domain name usingStripe's instructions.

2. You must serve your page over HTTPSusing a valid TLS 1.2 certificate. This canbe checked from your browser or fromSSL Labs.

3. Make sure that your HTTPS page doesnot load any images, css or javascriptinsecurely. You can check this byclicking the padlock on your browserURL bar.

4. Make sure that Stripe.js is enabled inthe module's configuration section andverified by placing a test order.

5. Check that Apple Pay is also enabled inthe module's configuration section.

6. For Apple Pay, use Safari on an iPhonerunning iOS 10 and above (not an iPad;Safari doesn't support them yet).

7. For Google Pay, use Chrome Desktop or

Page 12: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

Chrome Mobile with a logged in Googleaccount.

8. Make sure that you have at least onecard in your Wallet (in iOS, you can addone by going to Settings → Wallet &Apple Pay).

9. Test if your iOS device supports ApplePay by visitinghttps://stripe.com/apple-pay.

10. Test if your Android device supportsGoogle Pay by visiting the PaymentRequest Button documentation.

11. If you are using a OneStepCheckoutmodule, you may additionally need toconfigure the OSC module to refresh thepayment form when a billing addresshas been entered by a guest customer.In most cases, this would beunnecessary.

SAVED CARDSNo customer cards are ever saved on your servers. This feature works by creating a customerobject on Stripe's servers and saves the cards used on your store on that customer object. The followingis a screenshot of the checkout page after saved cards have been enabled and the customer haspreviously used at least one card.

Page 13: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

Saved cards will also work with IWD OnePage checkout and other one page checkout modules with noproblems.

Customers can also add or remove cards by logging into their account and navigating to the «My SavedCards» section.

Page 14: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

Please note that if you enable Saved Cards, it may add 1-2 seconds of lag on the checkout page forfetching saved card details from Stripe, which is the reason that this is disabled by default.

The module will always save the customer card if:

1. The "Save cards without asking" option is selected. From v2.2.2 onwards, this works for guestcustomers too.

2. You have Stripe Subscriptions installed and a subscription is purchased on the front-end. The cardwill be used for recurring billing events.

If you have Stripe.js enabled, adding cards from the customer account section is also PCI compliant.Stripe.js is used on the checkout page, admin area and the customer account section.

ISSUING REFUNDS1. Go to Sales > Orders, then find and click the order you would like to refund2. If the module is configured in «Authorize Only» mode, all you need to do is press the «Cancel»

button at the top of the page. If on the other hand the module is in the «Authorize and Capture»mode, continue to step 3.

3. From the left sidebar, click «Invoices», then click on the invoice to refund.

Page 15: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

4. At the top right hand corner, click «Credit Memo»5. Adjust the amount if necessary and click «Refund» at the bottom of the page.

6. For a partial refund, you can adjust the "Adjustment Fee". The amount you enter here is theamount that will not be refunded. In the screenshot above, when the adjustment fee is $10, then$184.98 will be refunded and $10 will be kept as a fee. You can ignore the "Adjustment Refund"field because Stripe cannot refund an amount that is greater than the original payment of thecustomer.

7. The amount should now be fully or partially refunded in Stripe and a note should appear in the«Comments History» of the order.

It is also perfectly fine to perform a refund directly from Stripe's dashboard; however doing so will notupdate Magento's dashboard figures on the total amount of sales, nor will it update the order status, sowe recommend to perform refunds through Magento whenever possible.

CAPTURING «AUTHORIZED ONLY» PAYMENTS

Page 16: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

1. Go to Sales > Orders.2. Find and click on the order for which you would like to capture a payment.3. Click on the «Invoice» button as shown in the screenshot.

4. If you need to issue a partial invoice, adjust the invoice items as shown on the screenshot.

5. Click on «Submit Invoice» to capture and finalize the payment.

You should now see the funds transferred to your account from Stripe's dashboard.

Warning: An authorized only payment will expire after 7 days, so make sure to capture your paymentsearly to avoid creating new charges for the customer. Your customers will also be happier if you providea speedy service.

Page 17: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

CAPTURING TELEPHONE ORDERS FROM THE ADMIN AREAIt is possible to create an order and charge a customer's card with details that you have received overthe telephone. This feature is also known as Mail Order/Telephone Order (MOTO). To create a MOTOorder:

1. Go to Sales > Orders2. At the top right hand side, click the Create New Order button3. Follow the steps and choose a customer, the store and the products for that order4. When you are ready to submit the order, fill in the card details as shown in the screenshot:

5. Don't forget to select a shipping method as well.6. Click the Submit Order button.

If the module is configured for Authorize and Capture, then the customer's card will have now beencharged and the funds transferred to your account. However, if the module is configured for AuthorizeOnly, you will need to also capture the payment by manually creating an invoice. Please refer to thesection Capturing «Authorized Only» payments for instructions on how to create this invoice.

Placing orders from the admin area will also validate the customer's billing address against the cardowner's address.

Page 18: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

ENABLING FRAUD PREVENTION FEATURES (STRIPE RADAR)The module supports three fraud prevention features, the standard CVC check, Stripe Radar and 3DSecure v2 / Dynamic 3D Secure.

The module will send the customer's entire billing and shipping address (address, postcode, country,telephone etc) to Stripe during the card tokenization step. When a shipping address is available, it willalso be sent for additional Stripe Radar checks. Stripe will then forward the billing address to thecustomer's bank where it will be compared to the real card owner's registered address. If Stripe Radardetects a high risk payment based on the provided information, then the payment may be placed underreview with an Elevated risk status. If you wish to automatically decline charges based on custom StripeRadar rules, you can create a rule from your Stripe Radar dashboard. You can also create custom rulesthat can place payments under review even if they do not have an Elevated risk status.

When Stripe Radar is enabled, any orders that are placed under manual review by Stripe Radar, will beautomatically placed on hold in Magento. You may wish to investigate these further before proceedingto fulfill the order. You can do this by checking the address verification results in your Magento adminarea, as shown in the following screenshot:

If you think that the order is not fraudulent, you can simply click the Unhold button on the order page.This will transition the order status to "Processing" or "Complete" and you can fulfill the ordernormally.

To test this feature, switch the module to Test Mode from the configuration section, and then place anorder using the card number 4000000000009235.

If you would like to add a custom message in sales emails for suspicious orders, you can edit the NewOrder email template from System > Transactional Emails. Open up the email template and add the

Page 19: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

following at the place where you would like the message to appear:

{{if order.getPayment().getIsFraudDetected()}} <table cellspacing="0" cellpadding="0" class="message-container"> <tr> <td>Your order needs to be reviewed before it can be fulfilled. Thank you for your patience.</td> </tr> </table> {{/if}}

3D SECURE V2 / DYNAMIC 3D SECUREStripe offers a card authentication feature called 3D Secure (also known as Verified by Visa, MasterCardSecureCode, J/Secure or American Express SafeKey) which can help merchants reduce fraud on theirwebsites. Due to a liability shift to the authorizing bank, you will no longer receive any chargebacks if a3D Secure session is used for payments on your website.

As of version 3.4.0 of the module, 3DSv2 replaces the old 3DSv1 system, so that is is compliant with the

Page 20: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

new PSD2 SCA regulations. The regulations will come into effect on the 14th Sept 2019, after whichpayments that do not use 3DSv2 will be declined. If you use v3.4.0 or newer, 3DSv2 is always enabledby default and the configuration option to disable it has been removed.

To test 3DSv2, switch the module to be in Test Mode and use any of the testing card numbers athttps://stripe.com/docs/testing#three-ds-cards. You can also test this on our demo server atdemo.cryozonic.com

To trigger 3DSv2 dynamically (for example for purchases from specific countries), you can add customrules in your Stripe Radar dashboard. For full details on how the system works with Stripe, please seehttps://stripe.com/guides/3d-secure-2

HOW TO STYLE THE PAYMENT FORMPlease note that the payment form will look different depending on which security method you areusing. Customizing Stripe.js v3 + Stripe Elements is more involved than other security methods,because the payment form is hosted on Stripe's servers.

A quick warning before we start - Styling any section in Magento is a theme designer's job, so if youhave not done this in the past, we always recommend to delegate this to an experienced Magento themedesigner. Any adjustments that you make to the payment form will need to be implemented in yourtheme, not directly into the module. This is so that when you upgrade the module, your changes are notlost.

There are 3 aspects of customizations to the payment form: HTML, CSS and JavaScript. If you are usingthe Stripe Elements security method, you will be concerned of all 3. If you are using a different securitysetting, you only need to be concerned about HTML and CSS.

CUSTOMIZE HTML MARKUP

You can find the payment form HTML markup underapp/design/frontend/base/default/template/cryozonic/stripe/form/standard.phtml. If you need tochange this file, copy it under your theme directory, for example, underapp/design/frontend/packageName/designName/template/cryozonic/stripe/form/standard.phtmlbefore making any changes to it. You may need to edit this file if for example, you want to split StripeElements fields into separate lines in the payment form. You can see how this is done in examples 2 and3 of the Stripe Elements styling guides.

Please have in mind that every time you upgrade the module, you must check if anything has changed instandard.phtml and manually transfer the changes to your copied theme file. This is because themarkup includes functionality that is important to things like saved cards, Apple Pay, initialization ofStripe.js etc.

Page 21: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

CUSTOMIZE CSS STYLESHEETS

If you only need cosmetic customizations, this is by far the easiest and safest way to customize thepayment form. You can apply CSS customizations anywhere you like in your theme, the only concern isto avoid adding your CSS changes inside the module files. When you upgrade the module, if you need tore-adjust the CSS, it will be immediately noticeable at the checkout page.

CUSTOMIZE JAVASCRIPT

Javascript editing is only relevant if you are using Stripe.js v3 with Stripe Elements. The main use caseis if you want to split Stripe Elements fields into separate lines in the payment form. You can see howthis is done in examples 2 and 3 of the Stripe Elements styling guides. Another use case is if you want topass CSS styling through the javascript code, however we recommend to avoid this whenever possible.It is safer to perform all CSS customizations through CSS additions in your theme, and only revert tothis method as a last resort for something that is not possible.

To modify the javascript, find and copy the initStripeElements() method fromskin/frontend/base/default/cryozonic_stripe/js/cryozonic_stripe.js.

Then, pick a javascript file in your theme that is loaded AFTER cryozonic_stripe.js, such as one that isloaded at the bottom of your page template. Most theme javascript files will be loaded after modulejavascript files. Once you have found the place to add the customization, you can overwrite the methodwith:

Page 22: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

cryozonic.initStripeElements = ...paste the copied method here...

You can then make any adjustments you need to this method.

Please have in mind that just like HTML modifications, every time you upgrade the module, you mustcheck if anything has changed in the original initStripeElements() method and manually transfer thechanges to your javascript file..

FINISHING UP WITH CUSTOMIZATIONS

After you have performed your customizations, you must additionally perform the following:

Flush your merged Javascript cache if Merged JS is enabledFlush your merged CSS cache if Merged CSS is enabledFlush any other caches that are implemented by 3rd party modules and caching systemsFlush your browser assets cache by either holding the "shift key" and pressing the refresh button,or by disabling the assets cache from your browser's web inspector. If your changes don't appear,you can also test in a different browser to check if it is a browser caching issue.

TRANSLATIONS FOR MULTI-LANGUAGE WEBSITESThe module contains a translations file that can be used with multi-language Magento configurations.You can find this file under:

/app/locale/en_US/Cryozonic_Stripe.csv

To create a translation file for a different language, you can copy the file under:

/app/locale/languagecode_COUNTRYCODE/Cryozonic_Stripe.csv

Make sure to replace languagecode_COUNTRYCODE with the locale code of the target locale language.This would be the same language that you selected under System > Configuration > General > General> Locale Options > Locale. If you must set your Locale configuration for the first time, make sure to alsoflush your Configuration Cache after doing so.

Once you have copied the file, you can simply edit the file and replace the second string on each rowwith the translation of the first string. There is nothing else you need to do for translations.

TROUBLESHOOTINGEnable Error Logging

The module will log any problems during checkout in Magento's System Log file. To take advantage of

Page 23: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

this feature, you will need to enable logging from System > Configuration > Developer > Log Settings.

Once you have enabled error logging, run the following command from your Magento directory (if youhave shell access):

$ tail -0f var/log/*

This will cause any errors to be displayed live. You can try to reproduce the error at this stage, whichwill give you a stream of all errors as they happen.

If you do not have shell access, just download the file, open it with your favourite text editor and searchfor «Stripe».

Enabling error logging will also write under var/report/. Make sure that these directories are writableby your Magento installation. To check the last 100 lines of the exception.log file, you can run thefollowing command:

$ tail -100 var/log/exception.log

If you are testing on a development website, you can also set Magento to display exceptions at the front-end by running the following command:

$ cp errors/local.xml.sample errors/local.xml

Front-End Crash (Website does not load)

If for any reason the installation has caused the entire Magento site to crash, causing your website tonot load, the first thing you need to do is to check for a maintenance.flag file in your Magento rootdirectory. This file gets created if a critical error has occurred with Magento. Just delete this file torestore website functionality.

Missing required param: number.

Please see the Stripe.js section below.

Order stuck in Pending status

Orders may get stuck in Pending status even if the payment was received for a number of possiblereasons:

1. You may not have configured webhooks yet, which are needed for redirect-based payment methodssuch as 3D Secure, Bancontact, Alipay etc.

2. You may have configured webhooks in Stripe for Test Mode, but your actual tests were in LiveMode. In this case you will also need to configure webhooks for Live Mode.

Page 24: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

3. You may have configured webhooks correctly, but the URL you used is returning a 301 Redirectinstead of a 200 OK status. This is the case with "http" vs "https", or when the "www." part ismissing from the domain name.

4. You may have configured webhooks correctly, but the endpoint is returning a 400 or 500 returncode when the actual webhook event is triggered. To check if this is the case, see steps 3 and 4 ofthe webhooks testing section. If an error is thrown, it will also be logged invar/log/cryozonic_stripe_webhooks.log

5. If the module's Payment Action is configured as "Authorize Only", then no invoices will be createdwhen the order is placed. You will manually need to issue an invoice using these instructions, whichwill switch the order status to Processing.

6. If you have Automatic Invoicing enabled, then an invoice WILL be created in Pending status, andthe order will be in "Pending Payment" status, which will also be switched to Processing after theinvoice is manually captured.

7. You may have simply configured the module to switch new orders to Pending status after they havebeen placed:

If this is the case, simply switch the setting to "-- Please Select --".8. Finally, if the payment method is asynchronous, it can take up to several days to confirm whether

the payment has been successful. During this time, the order in Magento will be Pending. You cancheck if the payment method used is asynchronous by referencing Stripe's list of supportedpayment methods. An indication if this is the case is if you can find a successful "POST/v1/charges" entry in your Stripe logs near the time of that order, but even though the charge wassuccessful, the payment does not appear under the Payments section.

Unable to use Stripe.js

This error indicates that Stripe.js is not working correctly on your checkout page. You can test if this isthe case by disabling Stripe.js from the module's configuration section as shown below:

Make sure to flush your configuration cache after disabling Stripe.js and before performing anothertest.

Disabling Stripe.js will increase compatibility with One Step Checkout modules or heavily customizedthemes and checkout pages. However to ensure increased security and PCI compliance, we do notrecommend disabling Stripe.js. We instead warn the website developer about the issue by displaying theerror that links to this page. In older versions of Stripe Payments, a fallback mechanism existed for

Page 25: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

convenience that would use the server-side Stripe API if Stripe.js could not be used, however in newerversions of the module, this is now enabled by default and the fallback mechanism was removed. Theonly reason for keeping Stripe.js disabled would be until a developer fixes the issue.

There are usually two common causes for this error:

1. Javascript crashes: If you are still developing the website, you are likely to have unstablemodules with javascript crashes in the browser's debugging console. When a javascript crashoccurs, all subsequent javascript execution is halted by the browser, resulting in Stripe.js not beinginitialized correctly at your checkout page. If you can see any javascript crashes in your browserconsole, fixing them should be the first thing to try in order for the checkout page to initializecorrectly.

2. One Step Checkout modules:

COMPATIBLE

The module has been tested with and integrated for with the following OSC modules:

IWD OnePage Checkout 4.0.4, 4.0.8, 4.3.4Idev OneStepCheckout 4.1.4, 4.5.4, 4.5.5AheadWorks OneStepCheckout 1.3.5FireCheckout 3.2.0, 3.7.1, 4.0.2MageGiant OneStepCheckout 4.0.0AwesomeCheckout 1.5.0 (you must additionally whitelist the module's JS and CSS fromAwesomeCheckout's configuration section)MageStore OneStepCheckout 3.5.0MageBay OSC 1.1.5Amasty OneStepCheckout 3.0.5NextBits OneStepCheckout 1.0.3Magecheckout OSC 2.2.1AdvancedCheckout OSC v2.5.0Magesolution Athlete Ultimate Magento Theme v1.1.2MageWorld OneStepCheckoutPro v3.4.4GoMage LightCheckout v5.8, v5.9MageCloud Clarion OSC v1.0.2PlumRocket OneStepCheckout 1.3.4Apptha 1StepCheckout v1.9FancyCheckout v1.2.6Lotusbreath OneStepCheckout v4.2.0

The above modules (and newer versions of them) will work with no modifications. You can checkthe changelog on the bottom of the product page to see if support for one of the above modules was

Page 26: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

only recently added.

INTEGRATION STEP NECESSARY

If you are using a OSC module from the following list, an integration step will be necessary:

MageStore OneStepCheckout 3.2.0 (how to integrate)SoftProdigy EnhancedCheckout 1.0.1 (how to integrate)Lotusbreath OneStepCheckout 4.1.1 (how to integrate)TypoStores OneStepCheckout 4.1.1 (how to integrate)Olegnax OneStepCheckout (how to integrate)

INCOMPATIBLE

The following modules are known to be incompatible with Stripe Payments:

IWD Checkout Suite 6.0.2

Other OSC modules tested by our clients work correctly with no modifications.

If you would like to attempt an integration yourself with a new OSC module, please refer to theinitOSCModules() method in skin/frontend/base/default/cryozonic_stripe/js/cryozonic_stripe.js forexamples on how to perform an integration.

For any other issues, please get in touch with customer support at [email protected].

Verify that Stripe.js is enabled

With Stripe Payments v2.3.2 and newer, Stripe.js is enabled by default in the module's configurationsection. For older versions, make sure that it is enabled from the configuration section. Once enabled, ifyou try to place a test order and Stripe.js is not working, then an error will be thrown directing you tothis documentation. A successful order means that Stripe.js is working correctly.

If Stripe.js is not working on your site, please see this section for possible troubleshooting solutions.

To additionally verify that Stripe.js was used from your Stripe dashboard, you can look intohttps://dashboard.stripe.com/logs/overview for requests to /v1/tokens. In the request body of thatrequest, you should be able to see Stripe.js in the following form:

{ ..., "payment_user_agent": "stripe.js/c437b32", ...,}

Page 27: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

Continue to Next Step button does not work (stuck spinner)

Possible reason 1: A front-end javascript crash

Magento and our Stripe module both use javascript to render the checkout view. If a javascript erroroccurs when you navigate to the checkout page, all subsequent javascript code execution stops, so thepage may get stuck with a loading spinner or it may render the checkout page incorrectly. To check if ajavascript crash may be causing this, you can use your browser's debugging console to check for errors,for example:

Errors such as the above, even if they are not caused by the module itself, they may prevent thecustomer from navigating or using the checkout page successfully. To make sure everything works asexpected, make sure that the debugging console is always free of javascript errors.

Possible reason 2: A server side crash

A server side error is a request which returns with code 500. To check if it is a 500 error, you can useyour browser's debugging console – for example in Chrome you can right-click and select Inspect.

If it is a 500 error, then under the Network tab of the console you will see a red network request asshown in the screenshot below:

Page 28: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

To find out what is causing the error, click on the line. You will see the error under the Response tab ofthe network request as shown below:

The error will give some clues as to where the crash is coming from. Usually it is some incompatibilitywith another module that tries to interfere with the checkout process, like triggering of custom emails,

Page 29: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

reward point modules etc. You can try to disable any such suspected modules by moving their xml filefrom app/etc/modules/ into a different directory. Do not try to disable conflicting modules from theadmin area – it doesn't always work.

If you can't find the error from the browser console, you can additionally check in your web server'serror log files and in Magento's error log files under var/log/.

Once you find the cause of the error, if you think that it is a crash with the Stripe module, send us thefull error report to [email protected] to receive further help. Otherwise if the error is thrown byanother 3 party module, you may be able to solve it faster by contacting the support team of thatmodule.

Continue to Next Step button redirects to the shopping cart

This is the same as above – a 500 server side error, please see the above section for instructions. Themain difference for finding the error cause will be that you will need to check the «Preserve log»checkbox in the debugging console so that the error message does not disappear after the redirect.

You cannot confirm this PaymentIntent because it has a status of succeeded. Only aPaymentIntent with one of the following statuses may be confirmed:requires_confirmation, requires_action.

This error can occur at the checkout page in the following scenario:

1. The customer reaches the final checkout page and clicks the Place Order button.2. At that point, the payment, which is triggered at the front-end through Stripe.js, is successful.3. After the payment succeeds, the order is also placed with Magento, however Magento crashes at the

checkout.

This scenario leaves a successful payment dangling without an associated order to go with it. If thishappens on a live website, you will need to manually refund the payment from your Stripe dashboard,and then investigate what caused the crash on the website.

If this happens during development, there will typically be 2 errors at the checkout. The first error is theone from the custom checkout feature that you are working on. This first error will be shown after thepayment was collected at the front-end. After the first error, clicking the Place Order twice will generatea different second error about the PaymentIntent, because you are trying to capture the payment morethan once. This is something that is safe to ignore during development and can be fixed by flushing yourMagento cache. Flushing the Magento cache will cause it to create a new PaymentIntent for yourcheckout session. If a new Payment Intent is created, then the first error will be displayed again whenyou try to place your order. You can then debug and fix the first error, which will prevent thePaymentIntent error from happening again.

rd

Page 30: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

For information on how to debug crashes at the checkout, see the following sections of thedocumentation:

Enable Error LoggingStuck loading spinner

Tracking down conflicts with other modules

Occationally merchants come across unusual errors that cannot be easily traced back to a specific cause.A common reason is when a 3rd party module is modifying Magento in a way that breaks functionalityin our Stripe modules. Some examples would be for a 3rd party module to:

overwrite the same models as our Stripe modulesbe changing the behaviour of how a checkout page submits information to Magentosplitting orders into twocaching asset files in a way that prevents the correct initialization of javascript dependenciesetc...

If you suspect that another module may be getting in the way, we recommend disabling all suspected3rd party modules using a specific method - by renaming their xml file underapp/etc/modules/Vendor_ModuleName.xml into app/etc/modules/Vendor_ModuleName.xml.bak.This is the only effective way of disabling a module that overwrites Magento models, i.e. if the samemodule was simply disabled from the admin area, it would have no effect on resolving the issue.

To trace the cause of the issue effectively, we recommend to disable as many suspected modules aspossible, sometimes going as far back to a barebones Magento setup with no enabled modules otherthan the Stripe module. If this approach fixes the issue, you can re-enable the modules one by one untilyou find the one causing the problem. Once the cause has been traced back into a conflict with a specificmodule, feel free to contact us with more details about the issue so that we can advice on the bestapproach to resolve it.

Broken Admin Area

If your Magento admin has broken (i.e. receiving a white screen of death) immediately after theinstallation, you may have forgotten to disable compilation mode before the installation. If you've gotshell access, try running the following command to disable compilation:

$ php shell/compiler.php disable

If that doesn't work, try commenting out the two define function calls in:

includes/config.php

Page 31: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

The above should fix the issue if it is compilation-related.

If the CSS/JS of your Magento admin have broken, it may be a merged CSS/caching issue. Have a lookhere on how to disable merged CSS manually. You can then flush all the caches.

Finally, this can happen because of insufficient write permissions on the var/cache directories. If that'sthe issue, make sure that your Magento directory is owned by the same user that is running the webserver before installing the module or configure your webserver to run as the same user that deploysthese files to your website.

$ chown –R <www-username> /magento_directory

Stripe no longer supports API requests made with TLS 1.0. Please initiate HTTPSconnections with TLS 1.2 or later.

Stripe requires TLS 1.2 as a minimum requirement for encrypting the connection between your websiteand Stripe. Many merchants and their hosting providers usually mistake this error message with thenormal HTTPS protocol for incoming connections from the web. However, this error actually refers tooutgoing connections from your website to the Stripe API. Outgoing connections will use the hostingprovider's installed version of OpenSSL and the PHP curl extension that is used to initiate the outgoingconnection. To check if the installed OpenSSL and curl version supports TLS 1.2, you can use this script.If this code fails, please upgrade OpenSSL and your curl version to the latest and try again. If you areunable to do that, you will need to contact your hosting provider to upgrade or reconfigure your server'sinstalled OpenSSL and curl.

For more details, please see

https://stripe.com/blog/upgrading-tlshttps://support.stripe.com/questions/how-do-i-upgrade-my-openssl-to-support-tls-1-2https://support.stripe.com/questions/how-do-i-upgrade-my-stripe-integration-from-tls-1-0-to-tls-1-2#php

Failed/Partial/Corrupted Installations

If you have received errors in the black installation console, or you get crashes during the checkout pageonly, you may have a partial/corrupted installation because of incorrect filesystem write permissions.For corrupted installations you will need to manually uninstall the module by deleting the followingfiles:

app/code/community/Cryozonic/Stripe/app/design/adminhtml/base/default/template/cryozonic/app/design/adminhtml/base/default/layout/cryozonic_stripe.xmlapp/design/frontend/base/default/template/cryozonic/

Page 32: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

app/design/frontend/base/default/layout/cryozonic_stripe.xmlapp/design/frontend/base/default/layout/customer/savedcards.xmlapp/etc/modules/Cryozonic_Stripe.xmlapp/locale/en_US/Cryozonic_Stripe.csvskin/adminhtml/base/default/cryozonic_stripe/skin/frontend/base/default/cryozonic_stripe/lib/Cryozonic

You will also need to clean the database:

1. Drop the mysql table cryozonic_stripesubscriptions_customers2. Open the mysql table core_resource, find and remove the entry for cryozonic_stripe_setup and

cryozonic_stripesubscriptions_setup

A corrupted installation may be caused by incorrect Magento directory permissions. Most of theseproblems can simply be fixed by changing the ownership of the Magento directories to the user runningthe webserver with:

$ chown –R <www-username> /magento_directory

Alternatively you can configure your webserver to run as the same user that deploys these files to yourwebsite.

If you do not have shell access to run the above command, the only other solution would be to performa manual installation and upload the files to your Magento directory over FTP.

The CSS/styling of the payment form is broken

The styling of the payment form depends on which security method you use.

Page 33: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

There are currently 3 security methods with the module:

Page 34: Stripe Payments - Magento 1 - Documentation · Magento setups, and can be used without setting up a mailing system on your Magento server. 18. Show Accepted Card Icons: This setting

None (The Stripe API is used from the PHP library)Stripe.js v2Stripe.js v3 with Stripe Elements

If you are using the Stripe API or the Stripe.js v2 security method, then the payment form template canbe found inside the Stripe Payments module. To change it, you can copyapp/design/frontend/base/default/template/cryozonic/stripe/form/standard.phtmlinside your theme directory and modify it there.

However, if you are using Stripe.js v3 with Stripe Elements, the form is hosted directly on Stripe'sservers inside an iframe for security purposes. Stripe provides some examples on how to style thispayment form. You can see from the examples that the payment form can be styled with either CSS orwith JS. For CSS, you can add the styles anywhere in your theme. For JS styling, you can add the stylingin the initStripeElements() method ofskin/frontend/base/default/cryozonic_stripe/js/cryozonic_stripe.js

If you are using a OneStepCheckout module, or a theme that changes the checkout page, it may also beworth checking the templates of the OSC module, as some OSC modules will make the payment formvery narrow, squashing together the form fields.

Another common configuration options with OSC modules is to change the checkout page layout fromsay, 3 columns, into 2 columns, which may make the form wider to fit the Stripe Elements fields.

THANKSThank you for choosing our Stripe modules. If you like the modules, we would much appreciate areview on magento connect.