> For the complete documentation index, see [llms.txt](https://docs.foloosi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.foloosi.com/payment-methods/saved-card-payment-method.md).

# Saved Card Payment Method

We work with card networks and automatically attempt to update saved card details whenever a customer gets a new card !

This Feature is available for all types of integration methods. But before integration kindly resolve your queries with foloosi's support team.

Sample Payment Page

<figure><img src="https://2728483298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQCT5TjkKNyS34llPoX%2Fuploads%2FY9IMlwIEqWWiNUq2y4bG%2Fsaved-card.png?alt=media&amp;token=13106cb0-afae-4b5e-8d53-6acfd2abc28d" alt=""><figcaption></figcaption></figure>

### Sample Integration Code

<pre><code>&#x3C;script type="text/javascript" src="https://www.foloosi.com/js/foloosipay.v2.js">&#x3C;/script>
&#x3C;script>
        // post data for create order id
        data = {
          transaction_amount : YOUR_TRANSACTION_AMOUNT,
          currency : YOUR_CURRENCY_CODE,
          customer_unique_identifier : 'Unique value',/** MANDATORY FIELD -Customer Unique Reference value should be email/mobile no/uniqueCustomer id from your DB*/
          customer_name : OPTIONAL ,/*note : auto render in payment popup*/
          customer_email : OPTIONAL, /*note : auto render in payment popup*/
          customer_mobile : OPTIONAL ,/*note : auto render in payment popup*/
          customer_address : OPTIONAL ,/*note : minimize form fields in card detail page*/
          customer_city : OPTIONAL /*note : minimize form fields in card detail page*/
<strong>        }
</strong>	let fetchRes = fetch(
            "https://api.foloosi.com/aggregatorapi/web/initialize-setup",{
            method: 'POST',
            headers: {
              'Content-Type': 'application/json',
              'merchant_key': 'YOUR_MERCHANT_KEY' /** get the merchant key from foloosi panel*/
            },
            body: JSON.stringify(data)
         });

	fetchRes.then(res =>
	  res.json()).then(d => {
  	    console.log(d.data);
            var options = {
                "reference_token" : d.data.reference_token, //which is get from step2
                "merchant_key" : "YOUR_MERCHANT_KEY",/** get the merchant key from foloosi panel*/
            }
            var fp1 = new Foloosipay(options);
            fp1.open();
        })
        foloosiHandler(response, function (e) {
          if(e.data.status == 'success'){
            //responde success code
            //console.log(e.data.status);
            //console.log(e.data.data.transaction_no);
          }
          if(e.data.status == 'error'){
            //responde success code
            //console.log(e.data.status);
            //console.log(e.data.data.payment_status);
          }
          if(e.data.status == 'closed'){
            //Payment Popup Closed
            //console.log(e.data);
          }
        });
&#x3C;/script>
</code></pre>

#### Note

*customer\_unique\_identifier* must be Mandatorily Passed and Customer Unique Reference value must be email or mobile number or uniqueCustomer id.

**NOTE**

Supports 170 World Currencies

#### Support

Visit <https://www.foloosi.com> for support requests or email to <tech@foloosi.com>.

## Developed by

Foloosi Technologies Pvt Ltd.

## License

Copyrights (c) 2025 Foloosi
