Documentation
¶
Index ¶
- Constants
- type CartProduct
- type Customer
- type Extra
- type FlexFloat
- type InitiateRefundRequest
- type InitiateRefundResponse
- type IpnResponse
- type OrderValidateRequest
- type OrderValidateResponse
- type PaymentRequest
- type PaymentResponse
- type Product
- type RefundQueryURLRequest
- type RefundQueryURLResponse
- type Shipping
- type TransactionQueryBySessionKeyRequest
- type TransactionQueryBySessionKeyResponse
- type TransactionQueryByTransactionIdRequest
- type TransactionQueryByTransactionIdResponse
Constants ¶
View Source
const ( // Shipping Methods ShippingMethodOnline = "online" ShippingMethodCourier = "courier" ShippingMethodNo = "no" // Product Categories ProductCategoryElectronics = "Electronics" ProductCategoryClothing = "Clothing" ProductCategoryDigital = "Digital" // Product Profiles ProductProfileGeneral = "general" ProductProfilePhysicalGoods = "physical-goods" ProductProfileNonPhysicalGoods = "non-physical-goods" ProductProfileAirlineTickets = "airline-tickets" ProductProfileTravelVertical = "travel-vertical" ProductProfileTelecomVertical = "telecom-vertical" // Payment Status PaymentStatusValid = "VALID" PaymentStatusValidated = "VALIDATED" PaymentStatusInvalidTransaction = "INVALID_TRANSACTION" PaymentStatusFailed = "FAILED" PaymentStatusCancelled = "CANCELLED" PaymentStatusUnattempted = "UNATTEMPTED" PaymentStatusExpired = "EXPIRED" // Currencies CurrencyBDT = "BDT" CurrencyUSD = "USD" CurrencyEUR = "EUR" CurrencyGBP = "GBP" )
Constants for PaymentRequest
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CartProduct ¶
type Customer ¶
type Customer struct {
Name string `json:"cus_name" url:"cus_name"`
Email string `json:"cus_email" url:"cus_email"`
Add1 string `json:"cus_add1" url:"cus_add1"`
Add2 string `json:"cus_add2" url:"cus_add2"`
City string `json:"cus_city" url:"cus_city"`
State string `json:"cus_state" url:"cus_state"`
Postcode string `json:"cus_postcode" url:"cus_postcode"`
Country string `json:"cus_country" url:"cus_country"`
Phone string `json:"cus_phone" url:"cus_phone"`
Fax string `json:"cus_fax" url:"cus_fax,omitempty"`
}
type FlexFloat ¶ added in v1.0.6
type FlexFloat float64
FlexFloat handles JSON fields that can be either a float or a string (e.g., "10.5" or 10.5)
func (*FlexFloat) UnmarshalJSON ¶ added in v1.0.6
type InitiateRefundRequest ¶
type InitiateRefundRequest struct {
BankTranId string `json:"bank_tran_id" url:"bank_tran_id"`
StoreId string `json:"store_id" url:"store_id"`
StorePasswd string `json:"store_passwd" url:"store_passwd"`
RefundAmount string `json:"refund_amount" url:"refund_amount"`
RefeId string `json:"refe_id" url:"refe_id"`
Format string `json:"format" url:"format"`
}
type InitiateRefundResponse ¶
type IpnResponse ¶
type IpnResponse struct {
Status string `json:"status"`
TranDate string `json:"tran_date"`
TranId string `json:"tran_id"`
ValId string `json:"val_id"`
Amount string `json:"amount"`
StoreAmount string `json:"store_amount"`
CardType string `json:"card_type"`
CardNo string `json:"card_no"`
Currency string `json:"currency"`
BankTranId string `json:"bank_tran_id"`
CardIssuer string `json:"card_issuer"`
CardBrand string `json:"card_brand"`
CardIssuerCountry string `json:"card_issuer_country"`
CardIssuerCountryCode string `json:"card_issuer_country_code"`
CurrencyType string `json:"currency_type"`
CurrencyAmount string `json:"currency_amount"`
ValueA string `json:"value_a"`
ValueB string `json:"value_b"`
ValueC string `json:"value_c"`
ValueD string `json:"value_d"`
VerifySign string `json:"verify_sign"`
VerifyKey string `json:"verify_key"`
RiskLevel string `json:"risk_level"`
RiskTitle string `json:"risk_title"`
}
func (*IpnResponse) IsValid ¶ added in v1.0.4
func (r *IpnResponse) IsValid() bool
IsValid checks if the transaction status is valid
type OrderValidateRequest ¶
type OrderValidateResponse ¶
type OrderValidateResponse struct {
Status string `json:"status"`
TranDate string `json:"tran_date"`
TranId string `json:"tran_id"`
ValId string `json:"val_id"`
Amount string `json:"amount"`
StoreAmount string `json:"store_amount"`
Currency string `json:"currency"`
BankTranId string `json:"bank_tran_id"`
CardType string `json:"card_type"`
CardNo string `json:"card_no"`
CardIssuer string `json:"card_issuer"`
CardBrand string `json:"card_brand"`
CardIssuerCountry string `json:"card_issuer_country"`
CardIssuerCountryCode string `json:"card_issuer_country_code"`
CurrencyType string `json:"currency_type"`
CurrencyAmount string `json:"currency_amount"`
CurrencyRate string `json:"currency_rate"`
BaseFair string `json:"base_fair"`
ValueA string `json:"value_a"`
ValueB string `json:"value_b"`
ValueC string `json:"value_c"`
ValueD string `json:"value_d"`
EmiInstalment string `json:"emi_instalment"`
EmiAmount string `json:"emi_amount"`
EmiDescription string `json:"emi_description"`
EmiIssuer string `json:"emi_issuer"`
AccountDetails string `json:"account_details"`
RiskTitle string `json:"risk_title"`
RiskLevel string `json:"risk_level"`
APIConnect string `json:"APIConnect"`
ValidatedOn string `json:"validated_on"`
GwVersion string `json:"gw_version"`
DiscountPercentage string `json:"discount_percentage,omitempty"`
DiscountAmount FlexFloat `json:"discount_amount,omitempty"`
DiscountRemarks string `json:"discount_remarks,omitempty"`
CartType string `json:"cart_type,omitempty"`
CartQuantity string `json:"cart_quantity,omitempty"`
AddressIsSame string `json:"address_is_same,omitempty"`
}
func (*OrderValidateResponse) IsValid ¶ added in v1.0.3
func (r *OrderValidateResponse) IsValid() bool
IsValid checks if the transaction status is valid
type PaymentRequest ¶
type PaymentRequest struct {
// Basic
StoreId string `json:"store_id" url:"store_id"`
StorePasswd string `json:"store_passwd" url:"store_passwd"`
TotalAmount float64 `json:"total_amount" url:"total_amount"`
Currency string `json:"currency" url:"currency"` // default:"BDT"
TranId string `json:"tran_id" url:"tran_id"`
ProductCategory string `json:"product_category" url:"product_category"`
SuccessUrl string `json:"success_url" url:"success_url"`
FailUrl string `json:"fail_url" url:"fail_url"`
CancelUrl string `json:"cancel_url" url:"cancel_url"`
IpnUrl string `json:"ipn_url" url:"ipn_url"`
// Card Details
MultiCardName string `json:"multi_card_name" url:"multi_card_name,omitempty"`
AllowedBin string `json:"allowed_bin" url:"allowed_bin,omitempty"`
EmiOption string `json:"emi_option" url:"emi_option,omitempty"`
EmiMaxInstOption string `json:"emi_max_inst_option" url:"emi_max_inst_option,omitempty"`
EmiSelectedInst string `json:"emi_selected_inst" url:"emi_selected_inst,omitempty"`
EmiAllowOnly string `json:"emi_allow_only" url:"emi_allow_only,omitempty"`
// Nested Structs
Customer `url:",squash"`
Shipping `url:",squash"`
Product `url:",squash"`
Extra `url:",squash"`
}
PaymentRequest represents the body of the payment request
func (*PaymentRequest) SetCart ¶
func (p *PaymentRequest) SetCart(products []CartProduct) error
SetCart sets the cart parameter by marshaling a slice of CartProduct
type PaymentResponse ¶
type PaymentResponse struct {
Status string `json:"status"`
Failedreason string `json:"failedreason"`
Sessionkey string `json:"sessionkey"`
Gw struct {
Visa string `json:"visa"`
Master string `json:"master"`
Amex string `json:"amex"`
Othercards string `json:"othercards"`
Internetbanking string `json:"internetbanking"`
Mobilebanking string `json:"mobilebanking"`
} `json:"gw"`
RedirectGatewayURL string `json:"redirectGatewayURL"`
DirectPaymentURLBank string `json:"directPaymentURLBank"`
DirectPaymentURLCard string `json:"directPaymentURLCard"`
DirectPaymentURL string `json:"directPaymentURL"`
RedirectGatewayURLFailed string `json:"redirectGatewayURLFailed"`
GatewayPageURL string `json:"GatewayPageURL"`
StoreBanner string `json:"storeBanner"`
StoreLogo string `json:"storeLogo"`
Desc []struct {
Name string `json:"name"`
Type string `json:"type"`
Logo string `json:"logo"`
Gw string `json:"gw"`
RFlag string `json:"r_flag,omitempty"`
RedirectGatewayURL string `json:"redirectGatewayURL,omitempty"`
} `json:"desc"`
IsDirectPayEnable string `json:"is_direct_pay_enable"`
}
type Product ¶
type Product struct {
Name string `json:"product_name" url:"product_name"`
Profile string `json:"product_profile" url:"product_profile"`
HoursTillDeparture string `json:"hours_till_departure" url:"hours_till_departure,omitempty"`
FlightType string `json:"flight_type" url:"flight_type,omitempty"`
Pnr string `json:"pnr" url:"pnr,omitempty"`
JourneyFromTo string `json:"journey_from_to" url:"journey_from_to,omitempty"`
ThirdPartyBooking string `json:"third_party_booking" url:"third_party_booking,omitempty"`
HotelName string `json:"hotel_name" url:"hotel_name,omitempty"`
LengthOfStay string `json:"length_of_stay" url:"length_of_stay,omitempty"`
CheckInTime string `json:"check_in_time" url:"check_in_time,omitempty"`
HotelCity string `json:"hotel_city" url:"hotel_city,omitempty"`
Type string `json:"product_type" url:"product_type,omitempty"`
TopupNumber string `json:"topup_number" url:"topup_number,omitempty"`
CountryTopup string `json:"country_topup" url:"country_topup,omitempty"`
Cart string `json:"cart" url:"cart,omitempty"`
Amount string `json:"product_amount" url:"product_amount,omitempty"`
Vat string `json:"vat" url:"vat,omitempty"`
DiscountAmount string `json:"discount_amount" url:"discount_amount,omitempty"`
ConvenienceFee string `json:"convenience_fee" url:"convenience_fee,omitempty"`
}
type RefundQueryURLRequest ¶
type RefundQueryURLResponse ¶
type Shipping ¶
type Shipping struct {
Method string `json:"shipping_method" url:"shipping_method"`
NumItems int `json:"num_of_item" url:"num_of_item"`
Name string `json:"ship_name" url:"ship_name"`
Add1 string `json:"ship_add1" url:"ship_add1"`
Add2 string `json:"ship_add2" url:"ship_add2"`
City string `json:"ship_city" url:"ship_city"`
State string `json:"ship_state" url:"ship_state"`
Postcode string `json:"ship_postcode" url:"ship_postcode"`
Country string `json:"ship_country" url:"ship_country"`
}
type TransactionQueryBySessionKeyResponse ¶
type TransactionQueryBySessionKeyResponse struct {
Status string `json:"status"`
Sessionkey string `json:"sessionkey"`
TranDate string `json:"tran_date"`
TranId string `json:"tran_id"`
ValId string `json:"val_id"`
Amount string `json:"amount"`
StoreAmount string `json:"store_amount"`
BankTranId string `json:"bank_tran_id"`
CardType string `json:"card_type"`
CardNo string `json:"card_no"`
CardIssuer string `json:"card_issuer"`
CardBrand string `json:"card_brand"`
CardIssuerCountry string `json:"card_issuer_country"`
CardIssuerCountryCode string `json:"card_issuer_country_code"`
CurrencyType string `json:"currency_type"`
CurrencyAmount string `json:"currency_amount"`
CurrencyRate string `json:"currency_rate"`
BaseFair string `json:"base_fair"`
ValueA string `json:"value_a"`
ValueB string `json:"value_b"`
ValueC string `json:"value_c"`
ValueD string `json:"value_d"`
RiskTitle string `json:"risk_title"`
RiskLevel string `json:"risk_level"`
APIConnect string `json:"APIConnect"`
ValidatedOn string `json:"validated_on"`
GwVersion string `json:"gw_version"`
}
type TransactionQueryByTransactionIdResponse ¶
type TransactionQueryByTransactionIdResponse struct {
APIConnect string `json:"APIConnect"`
NoOfTransFound int `json:"no_of_trans_found"`
Element []struct {
ValId string `json:"val_id"`
Status string `json:"status"`
ValidatedOn string `json:"validated_on"`
CurrencyType string `json:"currency_type"`
CurrencyAmount string `json:"currency_amount"`
CurrencyRate string `json:"currency_rate"`
BaseFair string `json:"base_fair"`
ValueA string `json:"value_a"`
ValueB string `json:"value_b"`
ValueC string `json:"value_c"`
ValueD string `json:"value_d"`
TranDate string `json:"tran_date"`
TranId string `json:"tran_id"`
Amount string `json:"amount"`
StoreAmount string `json:"store_amount"`
BankTranId string `json:"bank_tran_id"`
CardType string `json:"card_type"`
RiskTitle string `json:"risk_title"`
RiskLevel string `json:"risk_level"`
Currency string `json:"currency"`
BankGw string `json:"bank_gw"`
CardNo string `json:"card_no"`
CardIssuer string `json:"card_issuer"`
CardBrand string `json:"card_brand"`
CardIssuerCountry string `json:"card_issuer_country"`
CardIssuerCountryCode string `json:"card_issuer_country_code"`
GwVersion string `json:"gw_version"`
EmiInstalment string `json:"emi_instalment"`
EmiAmount string `json:"emi_amount"`
EmiDescription string `json:"emi_description"`
EmiIssuer string `json:"emi_issuer"`
Error string `json:"error"`
} `json:"element"`
}
Click to show internal directories.
Click to hide internal directories.