Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for IP field on source creation. #77

Merged
merged 5 commits into from
Mar 29, 2024

Conversation

aashishgurung
Copy link
Contributor

Description

Added support for IP field on source creation.

Sample code

package main

import (
	"log"

	"github.com/omise/omise-go"
	"github.com/omise/omise-go/operations"
)

const (
	// Read these from environment variables or configuration files!
	OmisePublicKey = "<PKEY>"
	OmiseSecretKey = "<SKEY>"
)

func main() {
	client, e := omise.NewClient(OmisePublicKey, OmiseSecretKey)
	if e != nil {
		log.Fatal(e)
	}

	// Creates a source from the token
	source, createSource := &omise.Source{}, &operations.CreateSource{
		Amount:   100000, // ฿ 1,000.00
		Currency: "thb",
		Type:     "wechat_pay",
		Ip:       "192.168.1.1",
	}
	if e := client.Do(source, createSource); e != nil {
		log.Fatal(e)
	}

	log.Printf("source: %s  amount: %s %d\n", source.ID, source.Currency, source.Amount)
	log.Printf("IP: %s\n", source.Ip)
}

Rollback procedure

default rollback procedure

Copy link

sonarqubecloud bot commented Mar 21, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@aashishgurung aashishgurung merged commit a73b37f into master Mar 29, 2024
6 checks passed
@aashishgurung aashishgurung deleted the support_ip_wechat branch March 29, 2024 06:20
@aashishgurung aashishgurung mentioned this pull request Apr 10, 2024
aashishgurung added a commit that referenced this pull request Apr 10, 2024
## Description

Release v1.4.0

### What's changed
- Added WeChat Pay support (PR:
[#77](#77))
- Updated README.md (PR:
[#76](#76) and
[#75](#75))

## Rollback procedure

`default rollback procedure`

Co-authored-by: Aashish <aashish@omise.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants