Skip to content
Golang Bindings For Conekta
Go
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
charge Passing local specs Feb 21, 2020
customer Passing local specs Feb 21, 2020
destination Added Payee Logic (#24) Apr 3, 2018
discountlines Refactor error handling (#18) Mar 9, 2018
lineitems Refactor error handling (#18) Mar 9, 2018
order Passing local specs Feb 21, 2020
payee Added Payee Logic (#24) Apr 3, 2018
paymentsource Added test for payment source psi (#31) May 30, 2018
readme_files conekta-go V1.0.0 release Jan 15, 2020
shippingcontact Refactor error handling (#18) Mar 9, 2018
shippinglines Refactor error handling (#18) Mar 9, 2018
taxlines Refactor error handling (#18) Mar 9, 2018
token Fix del fix Mar 23, 2018
transfer Added transfers logic (#25) Apr 11, 2018
webhook conekta-go V1.0.0 release Jan 15, 2020
.gitignore Dev (#15) Mar 8, 2018
CHANGELOG.md conekta-go V1.0.0 release Jan 15, 2020
LICENSE Initial commit Mar 17, 2016
README.md Update README.md Feb 7, 2020
charge.go Passing local specs Feb 21, 2020
conekta.go Feature reamining-test (#10) Mar 6, 2018
customer.go Field 'default_payment_source_id' and 'monthly_installments' is added Feb 19, 2020
destination.go Added Payee Logic (#24) Apr 3, 2018
discountlines.go Feature: Implement int64 (#16) Mar 8, 2018
error.go Feature: Implement token erro return (#22) Mar 22, 2018
lineitems.go
mocks.go Passing local specs Feb 21, 2020
order.go Field 'default_payment_source_id' and 'monthly_installments' is added Feb 19, 2020
payee.go Added transfers logic (#25) Apr 11, 2018
paymentsource.go Added logic to create a customer with a PCI payment source May 24, 2018
requestor.go Refactor error handling (#18) Mar 9, 2018
shippingcontact.go Added payment method and shiping contact actions and tests (#8) Feb 28, 2018
shippinglines.go Feature: Implement int64 (#16) Mar 8, 2018
taxlines.go
token.go Feature: Implement token erro return (#22) Mar 22, 2018
transfer.go Added transfers logic (#25) Apr 11, 2018
utils.go Added create, update, delete, find actions to customer (#7) Feb 28, 2018
webhook.go Feature: Adding Payee attributes at webhook object (#32) Aug 24, 2018

README.md

banner

Conekta GO

Requeriments

conekta-go is tested against against all officially supported releases (Go 1.12 and 1.13).

Installation

You can import conekta-go directly from github as follows:

import (
  conekta "github.com/conekta/conekta-go"
  "github.com/conekta/conekta-go/order"
  "github.com/conekta/conekta-go/customer"
  "time"
)

Usage

conekta.APIKey = "key_ZLy4aP2szht1HqzkCezDEA"

customerParams := &conekta.CustomerParams{
	Name:  "Cándida Eréndira",
	Email: "la.candida.erendira@gmail.com",
	Phone: "55-5555-5555",
}

lineItemParams := &conekta.LineItemsParams{
	Name:      "Naranjas Robadas",
	UnitPrice: 10000,
	Quantity:  2,
}

chargeParams := &conekta.ChargeParams{
	PaymentMethodParams: &conekta.PaymentMethodParams{
		Type:      "oxxo_cash",
		ExpiresAt: time.Now().AddDate(0, 0, 90).Unix(),
	},
}

orderParams := &conekta.OrderParams{}
orderParams.Currency = "MXN"
orderParams.CustomerInfo = customerParams
orderParams.LineItems = append(orderParams.LineItems, lineItemParams)
orderParams.Charges = append(orderParams.Charges, chargeParams)

ord, err := order.Create(orderParams)
if err != nil {
	code := err.(conekta.Error).Details[0].Code
	//do something
	fmt.Println(code)
} else {
	orderId := ord.ID
	chargeId := ord.Charges.Data[0].ID
	oxxoReference := ord.Charges.Data[0].PaymentMethod.Reference
	//do something
	fmt.Println(orderId)
	fmt.Println(chargeId)
	fmt.Println(oxxoReference)
}

Run Tests

go test -v ./...

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

  1. Fork the repository
  2. Clone the repository
    git clone git@github.com:yourUserName/conekta-go.git
  1. Create a branch
    git checkout develop
    git pull origin develop
    # You should choose the name of your branch
    git checkout -b <feature/my_branch>
  1. Make necessary changes and commit those changes
    git add .
    git commit -m "my changes"
  1. Push changes to GitHub
    git push origin <feature/my_branch>
  1. Submit your changes for review, create a pull request

    To create a pull request, you need to have made your code changes on a separate branch. This branch should be named like this: feature/my_feature or fix/my_fix.

    Make sure that, if you add new features to our library, be sure to add the corresponding unit tests.

    If you go to your repository on GitHub, you’ll see a Compare & pull request button. Click on that button.


License

Developed in Mexico by Conekta. Available with MIT License.

We are always hiring!

If you are a comfortable working with a range of backend languages (Java, Python, Ruby, PHP, etc) and frameworks, you have solid foundation in data structures, algorithms and software design with strong analytical and debugging skills. Send us your CV and GitHub to quieroser@conekta.com

You can’t perform that action at this time.