-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
58 lines (51 loc) · 1.58 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package main
import (
"fmt"
"github.com/TibebeJs/yenepay.sdk.go/checkout"
)
func main() {
yenepay := checkout.NewYenePayCheckOut()
fmt.Println("***************[ Express Checkout ]***************")
fmt.Println(yenepay.ExpressCheckoutURL(checkout.NewOption(
checkout.OptionsParams{
UseSandbox: true,
Process: checkout.ExpressCheckout,
MerchantID: "0694",
SuccessURL: "http://localhost:3000/Home/PaymentSuccessReturnURL",
CancelURL: "http://localhost:3000/Home/CancelReturnURL",
IPNURL: "http://localhost:3000/Home/IPNURL",
FailureURL: "http://localhost:3000/Home/FailureURL",
ExpiresAfter: 2880,
MerchantOrderID: "ab-cd",
},
), checkout.NewExpressCheckoutItem(
checkout.ExpressParams{ItemID: "544", ItemName: "PC", UnitPrice: 30.0, Quantity: 2},
)))
fmt.Println("***************[ Cart Checkout ]***************")
fmt.Println(yenepay.CartCheckoutURL(checkout.NewOption(
checkout.OptionsParams{
UseSandbox: true,
Process: checkout.ExpressCheckout,
MerchantID: "0694",
SuccessURL: "http://localhost:3000/Home/PaymentSuccessReturnURL",
CancelURL: "http://localhost:3000/Home/CancelReturnURL",
IPNURL: "http://localhost:3000/Home/IPNURL",
FailureURL: "http://localhost:3000/Home/FailureURL",
ExpiresAfter: 2880,
MerchantOrderID: "ab-cd",
},
), []checkout.CartCheckoutItem{
{
ItemID: "544",
ItemName: "PC",
UnitPrice: 30.0,
Quantity: 2,
},
{
ItemID: "541",
ItemName: "PC2",
UnitPrice: 30.0,
Quantity: 2,
},
}))
}