· 5 years ago · Jan 06, 2020, 02:10 PM
1Option Explicit On
2Option Strict On
3Imports System.Reflection.MethodBase
4Imports System.Runtime.Serialization
5Imports Newtonsoft.Json
6Imports Newtonsoft.Json.Linq
7Imports Stripe
8Imports Stripe.Checkout
9
10
11
12Partial Class help_donation_Default : Inherits Page
13    Public publishKey As String = ConfigurationManager.AppSettings("publishable_KeyTest")
14    Public secretKey As String = ConfigurationManager.AppSettings("secret_keyTest")
15
16    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
17        StripeConfiguration.ApiKey = ConfigurationManager.AppSettings("secret_keyTest")
18
19        If (Request.Form("dd") = "gg") Then
20            Call MakePayment()
21        End If
22
23
24    End Sub
25
26    Private Sub MakePayment()
27        Response.Write("<br>**payment")
28        StripeConfiguration.ApiKey = ConfigurationManager.AppSettings("secret_keyTest")
29
30        Try
31            Dim service = New PaymentIntentService()
32            Dim options = New PaymentIntentCreateOptions With {
33                .PaymentMethodTypes = New List(Of String) From {
34                    "card"
35                },
36                .Amount = 1098,
37                .PaymentMethod = Request("PaymentMethodId"),
38                .Currency = "gbp",
39                .Description = "Donation1"
40            }
41            service.Create(options)
42
43        Catch ex As Exception
44            Response.Write("<br>**" & ex.ToString)
45        End Try
46    End Sub
47
48
49
50
51End Class