amount := int64(1299)
currency := "KRW"
country := "KR"
method := components.RedirectPaymentMethodCreateMethodKcp
redirectUrl := "https://example.com/callback"
redirectPaymentMethodCreate := components.RedirectPaymentMethodCreate{
Method: method,
Country: country,
Currency: currency,
RedirectURL: redirectUrl,
}
paymentMethod := components.CreateTransactionCreatePaymentMethodRedirectPaymentMethodCreate(redirectPaymentMethodCreate)
transactionCreate := components.TransactionCreate{
Amount: amount,
Currency: currency,
Country: &country,
PaymentMethod: &paymentMethod,
CartItems: []components.CartItem{
{
Name: "Road bike",
Quantity: 1,
UnitAmount: 1299,
Description: gr4vy.String("Carbon road bike, size 56"),
},
},
}
transaction, err := client.Transactions.Create(ctx, transactionCreate, nil, nil, nil)