-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
meliguilhermefernandes
committed
Feb 8, 2024
1 parent
43d9453
commit c7986e6
Showing
7 changed files
with
61 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package integration | ||
|
||
import ( | ||
"context" | ||
"os" | ||
"testing" | ||
|
||
"github.com/mercadopago/sdk-go/pkg/cardtoken" | ||
"github.com/mercadopago/sdk-go/pkg/config" | ||
) | ||
|
||
func TestCardToken(t *testing.T) { | ||
t.Run("should_create_card_token", func(t *testing.T) { | ||
cfg, err := config.New(os.Getenv("ACCESS_TOKEN")) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
client := cardtoken.NewClient(cfg) | ||
res, err := client.Create(context.Background(), cardtoken.MockCardTokenRequest()) | ||
|
||
if res == nil { | ||
t.Error("res can't be nil") | ||
} | ||
if err != nil { | ||
t.Errorf(err.Error()) | ||
} | ||
}) | ||
} |