Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!DOCTYPE html>

<html lang="en">
  <head>
  <!-- Other Tags -->
  <title>Moyasar payment form</title>
  <meta charset="UTF-8" />

  <!-- Moyasar Styles -->
  <link rel="stylesheet" href="https://cdn.moyasar.com/mpf/1.9.0/moyasar.css" />

  <!-- Moyasar Scripts -->
  <script src="https://polyfill.io/v3/polyfill.min.js?features=fetch"></script>
  <script src="https://cdn.moyasar.com/mpf/1.9.0/moyasar.js"></script>
  <script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio,line-clamp"></script>

  <!-- Download CSS and JS files in case you want to test it locally, but use CDN in production -->
</head>
  <body>
  
  <section style="display: flex; height: 100%; width: 100%; justify-content: center; justofy-items: center;">
    <div class="mysr-form" style="width: 360px; margin: 40px 0 0 0"></div>
  </section>

  <script>
    Moyasar.init({
      element: '.mysr-form',
      // Amount in the smallest currency unit.
      // For example:
      // 10 SAR = 10 * 100 Halalas
      // 10 KWD = 10 * 1000 Fils
      // 10 JPY = 10 JPY (Japanese Yen does not have fractions)
      amount: 1000,
      currency: 'SAR',
      description: 'Coffee Order #1',
      publishable_api_key: 'pk_test_AQpxBV31a29qhkhUYFYUFjhwllaDVrxSq5ydVNui',
      callback_url: 'https://moyasar.com/thanks',
      methods: ['creditcard', 'stcpay'],
      fixed_width: false, // optional, only for demo purposes
      credit_card: {
        save_card: true
      },
      on_initiating: function () {
            return new Promise(function (_, reject) {
                setTimeout(function () {
                    reject('This is just a sample form, it won\'t work ;)');
                }, 2000);
            });
        }
    })
  </script>
</body>
</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console