Step 1 - Access admin panel
Login to your Shopify account and open your store admin.
Step 2 - Create manual payment method
- Go to Settings - Payments.
- Create a custom payment method.
- Set title/details/instructions (for example: pay online with CrossPay).
- Activate payment method.
Step 3 - Add script in Additional scripts
Go to Settings - Payments - Order processing - Additional scripts and add your redirect script.
<script type="text/javascript">
var api_data = "82e4b4fd3a16ad99229af9911ce8e6d2";
var invoice_id = ("{{ order_name }}").replace('#','');
var apiKey = "Customer Api-Key in Bill";
var total = {{ total_price }} / 100;
var currency = "USD";
var inv_info = [{"row_title":"Tax","row_value":"2"},{"row_title":"Delivery","row_value":"1"},{"row_title":"Capon","row_value":1},{"row_title":"Discount","row_value":0}];
var userName = "{{ billing_address.name }}";
var return_url = "Api Link Path";
var email = "{{ email }}";
var mobile = "{{ shipping_address.phone }}";
var url = "https://crosspayonline.com/api/createInvoiceByAccount?api_data="+api_data+"&invoice_id="+invoice_id+"&apiKey="+apiKey+"&total="+total+"¤cy="+currency+"&inv_details={\"inv_items\":[{\"name\":\"Shoping From Store\",\"quntity\":\"1\",\"unitPrice\":\""+total+"\",\"totalPrice\":\""+total+"\",\"currency\":\"USD\"}],\"inv_info\":"+JSON.stringify(inv_info)+",\"user\":{\"userName\":\""+userName+"\"}}&return_url="+return_url+"&email="+email+"&mobile="+mobile+"&name="+userName;
window.location.href = url;
</script>
Replace token/api key and return URL with your real values before production.
Step 4 - Success and failure pages
- Go to Online Store - Pages.
- Create Success page and Failure page.
- Provide both URLs to CrossPay support for redirect setup.
Create private app
- Go to Apps - Manage private apps.
- Create a new private app (for example: CrossPay Online).
- Grant required Admin API order permissions.
- Share store domain and app password with CrossPay integration engineer.