> For the complete documentation index, see [llms.txt](https://docs.shoppego.my/tutorials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shoppego.my/tutorials/ms/settings/payment/payment-gateway/stripe.md).

# Stripe

Bagi menggunakan Stripe sila pastikan anda **sudah cipta** terlebih dahulu **akaun Stripe.**

{% hint style="info" %}
**Urusan pengesahan akaun, caj dan wang transaksi** adalah **diuruskan sepenuhnya oleh pihak Stripe**.
{% endhint %}

{% hint style="danger" %}
Jumlah transaksi minimum untuk Stripe ialah sekurang-kurangnya RM2.00
{% endhint %}

## Dapatkan API key di Stripe

1\. Pendaftaran akaun Stripe boleh dibuat di : <https://dashboard.stripe.com/register>

2\. Untuk mendapatkan api key anda boleh mencarinya di **dashboard** atau klik sahaja link ini : <https://dashboard.stripe.com/login?redirect=%2Faccount%2Fapikeys>

3\. Setelah anda mendapatkan **Publishable key** dan **Secret key** anda boleh simpankan key tersebut untuk penetapan di Shoppego.

![](https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-e7d42fabca0d813e48adac8932f953ceef0eff39%2F-MD8Z-UDHUXIhH4PNbRk.png?alt=media)

## Penetapan Webhooks di Stripe

Terdapat 2 jenis webhooks yang anda perlu masukkan pada penetapan webhooks akaun Stripe anda, iaitu:\
1\. <https://hartamas.myshoppegram.co&#x6D;**/webhooks/payments/callback/checkouts/stripe**\\\\> 2. <https://hartamas.myshoppegram.co&#x6D;**/webhooks/payments/callback/typ\\\\_offer/stripe>\*\*

Anda **diwajibkan untuk menggantikan** [**https://hartamas.myshoppegram.com**](https://hartamas.myshoppegram.com) **tersebut dengan URL** [**https://subdomain.myshoppegram.com**](https://subdomain.myshoppegram.com) **website anda yang tersendiri yang telah diberikan secara percuma sewaktu pendaftaran akaun Shoppego anda** tersebut.

Anda boleh dapati URL subdomain anda pada bahagian berikut:\
Dashboard Overview Shoppego -> **Settings** -> **Custom domain** -> **Subdomain**

<figure><img src="https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-7967a6f701c7e0ac55a01618c857c2fe928d4335%2Fi6ChVkQCDHAFSqE60OI8.jpg?alt=media" alt=""><figcaption></figcaption></figure>

Anda boleh rujuk contoh penetapan webhooks dibawah:

1. Didalam dashboard Stripe tersebut, anda boleh klik pada bahagian **Developers** -> **Webhooks**. Anda juga boleh klik pada link ini terus: <https://dashboard.stripe.com/webhooks>

<figure><img src="https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-31d09ecea48618635d83c565ddb2f23e3e8b23ef%2FCpjwIAo8ZjwuuYrEEMAS.png?alt=media" alt=""><figcaption></figcaption></figure>

2. Seterusnya, anda boleh klik pada **Add an endpoint/Add endpoint**

<figure><img src="https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-e4e6fbf03f2725ed5d010badf4bdada243e15b8f%2FOuVy4UW3iXmuB2PvOKBk.jpg?alt=media" alt=""><figcaption></figcaption></figure>

3. Seterusnya, anda boleh **masukkan salah satu URL webhooks store anda yang tersendiri pada bahagian Endpoint URL**. Sebagai contoh disini, kami telah masukkan URL ini terlebih dahulu: <https://hartamas.myshoppegram.com/webhooks/payments/callback/checkouts/stripe>

<figure><img src="https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-c3495696c67cb90f9c18a0a12ad7242aba59c628%2FIk4VT0UP5PyIaSt12KgA.jpg?alt=media" alt=""><figcaption></figcaption></figure>

4. Kemudian, anda boleh **klik** pada **butang Select events**

<figure><img src="https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-8c62245eacbad778a5f001ef21bac4e7e814a4c8%2FMxpMbYZlb9i8iXiIRmcL.jpg?alt=media" alt=""><figcaption></figcaption></figure>

5. Setelah anda dapat lihat paparan pemilihan events, anda boleh **cari events** yang mempunyai nama **Payment Intent** dan anda boleh **klik pada event tersebut**.

<figure><img src="https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-5ca19df54d2729a2c44b88c4716f0d89019d8760%2F0LHR70LozLVqfOyaLxke.jpg?alt=media" alt=""><figcaption></figcaption></figure>

6. Kemudian, anda boleh **tick Select all Payment Intent events** terlebih dahulu.

<figure><img src="https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-1bc463a040335e355575029a5171240ff0fe1511%2F8Nf6CxecwtHrQUzb8ZJg.jpg?alt=media" alt=""><figcaption></figcaption></figure>

7. Seterusnya, anda boleh **untick checkbox payment\_intent.amount\_capturable\_updated** dan **payment\_intent.partially\_funded**

<figure><img src="https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-f64cc2dc65b26b483c5197aeea2a8adcddff7c17%2FJZKdsrfIT6SbXq5SsmlU.jpg?alt=media" alt=""><figcaption></figcaption></figure>

8. Setelah selesai, anda boleh klik pada butang **Add events**

<figure><img src="https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-5ed9a929521b5755c3bfc9221cc4f8a0d11df01c%2FB7pysE3FIrK6VtUIhfRi.jpg?alt=media" alt=""><figcaption></figcaption></figure>

9. Setelah anda pastikan penetapan anda sudah betul, anda boleh klik pada butang **Add endpoint**

<figure><img src="https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-d9c58ac572ec3850187f4f467c8a664fa8f39dc9%2FNaHsOzf9DUpkLy5hh1Nk.jpg?alt=media" alt=""><figcaption></figcaption></figure>

10. Jika anda dibawa kehalaman ini, anda boleh klik sahaja semula pada butang **Webhooks**

<figure><img src="https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-48ce457e513aab951dc2cc765cb82e88c3f4870d%2F4x6TKKV933cjpI9JZssW.jpg?alt=media" alt=""><figcaption></figcaption></figure>

11. Nanti, anda akan dibawa semula ke halaman Webhooks dan anda boleh lihat penetapan endpoint yang anda baru lakukan sebelum ini. Seterusnya anda boleh **ulang langkah diatas dan masukkan pula endpoint/webhooks URL yang kedua**.

<figure><img src="https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-f9fcd1bba0b87e45557a9752944bde28a3f0302b%2FL7jz5pi7hCvs6MkxqskS.png?alt=media" alt=""><figcaption></figcaption></figure>

Setelah selesai, anda sepatutnya akan mempunyai **2 endpoint/webhooks URL** seperti pada paparan dibawah:

<figure><img src="https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-63e8cb0dcb75e9f68547609091813ee22b05048d%2FQTvA4EazoEqf1DyPbjn0.png?alt=media" alt=""><figcaption></figcaption></figure>

## Penetapan di Shoppego

1\. Log masuk ke akaun Shoppego anda.

![](https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-b853fc0189b34fb1d3990f5b1f53fa71deb9d384%2FlCN7aw3FznaFFoOAyya2.jpg?alt=media)

2\. Klik pada **Settings**

![](https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-9ae8b66b366958146673b78216b78ff0e8f12b90%2FVsK9zs6aZtUfKK1hcCiM.jpg?alt=media)

3\. Klik pada **Payment options**

![](https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-6887bc460f7731261524a21148108938e4436a20%2FCA5qmbxGnMXdjUXh5W4M.jpg?alt=media)

4\. Jika anda belum aktifkan payment option untuk Stripe. Klik butang **Activate** pada bahagian **Alternative Payments** untuk Stripe. Jika anda sudah aktifkan payment option untuk Stripe klik butang **Edit.**

![](https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-e8c36895cfd828782ab6f58fb4e7922c7408e468%2F4RR2o2QPI4YtfTS3OtQk.jpg?alt=media)

5\. Seterusnya akan keluar paparan seperti dibawah, anda boleh isi maklumat tersebut :

![](https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-46618f52981e8ecc5b53c584a037ba3445b1e16c%2FY7mRZk9lurcPP9Bixg7T.jpg?alt=media)

* **Display name at checkout : Masukkan nama payment yang anda inginkan ( Contoh Online Payment )**
* **Publishable key : Masukkan Publishable key yang anda sudah dapatkan di akaun Stripe anda.**
* **Secret key : Masukkan Secret key yang anda sudah dapatkan di akaun Stripe anda.**

6\. Setelah selesai pastikan anda sudah klik **Enable** dan klik button **Save**.

{% hint style="info" %}
Sekiranya anda ingin **memulakan transaksi sebenar**, diminta untuk anda <mark style="color:red;">**mematikan**</mark> toggle **Test Mode** itu.
{% endhint %}

![](https://3359028955-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lh09fNwqqta5Vj6Wr8p%2Fuploads%2Fgit-blob-98b982aebc5bdb277f6335cf5ed0028a82bdefa7%2FdS3chJnBh2OUueJHYYAi.png?alt=media)

7\. Setelah **Save** anda boleh membuat percubaan pembelian pada website anda untuk lihat payment option Stripe tersebut semasa checkout untuk penetapan yang anda baru tetapkan sebentar tadi.
