Documentation
¶
Index ¶
- type BankAccount
- type Card
- type ChargeRequest
- type DefaultChargeService
- func (s *DefaultChargeService) CheckPending(reference string) (response.Response, error)
- func (s *DefaultChargeService) Create(req *ChargeRequest) (response.Response, error)
- func (s *DefaultChargeService) SubmitBirthday(birthday, reference string) (response.Response, error)
- func (s *DefaultChargeService) SubmitOTP(otp, reference string) (response.Response, error)
- func (s *DefaultChargeService) SubmitPIN(pin, reference string) (response.Response, error)
- func (s *DefaultChargeService) SubmitPhone(phone, reference string) (response.Response, error)
- func (s *DefaultChargeService) Tokenize(req *ChargeRequest) (response.Response, error)
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BankAccount ¶
type BankAccount struct {
Code string `json:"code,omitempty"`
AccountNumber string `json:"account_number,omitempty"`
}
BankAccount is used as bank in a charge request
type Card ¶
type Card struct {
Number string `json:"card_number,omitempty"`
CVV string `json:"card_cvc,omitempty"`
ExpirtyMonth string `json:"expiry_month,omitempty"`
ExpiryYear string `json:"expiry_year,omitempty"`
AddressLine1 string `json:"address_line1,omitempty"`
AddressLine2 string `json:"address_line2,omitempty"`
AddressLine3 string `json:"address_line3,omitempty"`
AddressCountry string `json:"address_country,omitempty"`
AddressPostalCode string `json:"address_postal_code,omitempty"`
Country string `json:"country,omitempty"`
}
Card represents a Card object
type ChargeRequest ¶
type ChargeRequest struct {
Email string `json:"email,omitempty"`
Amount float32 `json:"amount,omitempty"`
Birthday string `json:"birthday,omitempty"`
Card *Card `json:"card,omitempty"`
Bank *BankAccount `json:"bank,omitempty"`
AuthorizationCode string `json:"authorization_code,omitempty"`
Pin string `json:"pin,omitempty"`
Metadata *client.Metadata `json:"metadata,omitempty"`
}
ChargeRequest represents a Paystack charge request
type DefaultChargeService ¶
DefaultChargeService handles operations related to bulk charges For more details see https://developers.paystack.co/v1.0/reference#charge-tokenize
func (*DefaultChargeService) CheckPending ¶
func (s *DefaultChargeService) CheckPending(reference string) (response.Response, error)
CheckPending returns pending charges When you get "pending" as a charge status, wait 30 seconds or more, then make a check to see if its status has changed. Don't call too early as you may get a lot more pending than you should. For more details see https://developers.paystack.co/v1.0/reference#check-pending-charge
func (*DefaultChargeService) Create ¶
func (s *DefaultChargeService) Create(req *ChargeRequest) (response.Response, error)
Create submits a charge request using card details or bank details or authorization code For more details see https://developers.paystack.co/v1.0/reference#charge
func (*DefaultChargeService) SubmitBirthday ¶
func (s *DefaultChargeService) SubmitBirthday(birthday, reference string) (response.Response, error)
SubmitBirthday submits Birthday when requested For more details see https://developers.paystack.co/v1.0/reference#submit-pin
func (*DefaultChargeService) SubmitOTP ¶
func (s *DefaultChargeService) SubmitOTP(otp, reference string) (response.Response, error)
SubmitOTP submits OTP to continue a charge For more details see https://developers.paystack.co/v1.0/reference#submit-pin
func (*DefaultChargeService) SubmitPIN ¶
func (s *DefaultChargeService) SubmitPIN(pin, reference string) (response.Response, error)
SubmitPIN submits PIN to continue a charge For more details see https://developers.paystack.co/v1.0/reference#submit-pin
func (*DefaultChargeService) SubmitPhone ¶
func (s *DefaultChargeService) SubmitPhone(phone, reference string) (response.Response, error)
SubmitPhone submits Phone when requested For more details see https://developers.paystack.co/v1.0/reference#submit-pin
func (*DefaultChargeService) Tokenize ¶
func (s *DefaultChargeService) Tokenize(req *ChargeRequest) (response.Response, error)
Tokenize tokenizes payment instrument before a charge For more details see https://developers.paystack.co/v1.0/reference#charge-tokenize
type Service ¶
type Service interface {
Create(req *ChargeRequest) (response.Response, error)
Tokenize(req *ChargeRequest) (response.Response, error)
SubmitPIN(pin, reference string) (response.Response, error)
SubmitOTP(otp, reference string) (response.Response, error)
SubmitPhone(phone, reference string) (response.Response, error)
SubmitBirthday(birthday, reference string) (response.Response, error)
CheckPending(reference string) (response.Response, error)
}