-
Notifications
You must be signed in to change notification settings - Fork 9
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
1 parent
ee8e546
commit 830efc0
Showing
20 changed files
with
355 additions
and
333 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,30 @@ | ||
package paypal | ||
package paypal_test | ||
|
||
import ( | ||
"fmt" | ||
"github.com/smartwalle/paypal" | ||
"testing" | ||
) | ||
|
||
func TestPayPal_GetDisputeList(t *testing.T) { | ||
var param = &DisputeListParam{} | ||
var param = &paypal.DisputeListParam{} | ||
param.PageSize = 10 | ||
var results, err = paypal.GetDisputeList(param) | ||
var result, err = client.GetDisputeList(param) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
for _, dispute := range results.Items { | ||
fmt.Println(dispute.DisputeId, dispute.Status) | ||
for _, dispute := range result.Items { | ||
t.Log(dispute.DisputeId, dispute.Status) | ||
} | ||
|
||
for _, link := range result.Links { | ||
t.Log(link.Method, link.Rel, link.Href, link.EncType) | ||
} | ||
} | ||
|
||
func TestPayPal_GetDisputeDetails(t *testing.T) { | ||
//var results, err = paypal.GetDisputeDetails("PP-000-042-621-836") | ||
//if err != nil { | ||
// t.Fatal(err) | ||
//} | ||
//fmt.Println(results.DisputeId, results.DisputedTransactions[0].InvoiceNumber) | ||
var result, err = client.GetDisputeDetails("PP-000-042-621-836") | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
t.Log(result.DisputeId, result.DisputedTransactions[0].InvoiceNumber) | ||
} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
package paypal | ||
package paypal_test |
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 |
---|---|---|
@@ -1,41 +1,45 @@ | ||
package paypal | ||
package paypal_test | ||
|
||
import ( | ||
"github.com/smartwalle/paypal" | ||
"testing" | ||
) | ||
|
||
func TestPayPal_CreateWebExperienceProfile(t *testing.T) { | ||
//var p = &WebProfiles{} | ||
//p.Name = "Test Name" | ||
//p.Presentation = &WebProfilesPresentation{} | ||
//p.Presentation.LogoImage = "" | ||
//p.Presentation.BrandName = "" | ||
// | ||
//var result, err = paypal.CreateWebExperienceProfile(p) | ||
//fmt.Println(err) | ||
//fmt.Println(result.Id, result.Presentation.LogoImage) | ||
var p = &paypal.WebProfiles{} | ||
p.Name = "Test Name" | ||
p.Presentation = &paypal.WebProfilesPresentation{} | ||
p.Presentation.LogoImage = "" | ||
p.Presentation.BrandName = "" | ||
|
||
var result, err = client.CreateWebExperienceProfile(p) | ||
|
||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
t.Log(result.Id, result.Presentation.LogoImage) | ||
} | ||
|
||
func TestPayPal_GetWebExperienceProfileList(t *testing.T) { | ||
//var results, err = paypal.GetWebExperienceProfileList() | ||
//if err != nil { | ||
// t.Fatal(err) | ||
//} | ||
// | ||
//for _, profile := range results { | ||
// fmt.Println(profile.Id, profile.Name) | ||
//} | ||
var result, err = client.GetWebExperienceProfileList() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
for _, profile := range result { | ||
t.Logf(profile.Id, profile.Name) | ||
} | ||
} | ||
|
||
func TestPayPal_DeleteWebExperienceProfile(t *testing.T) { | ||
//var err = paypal.DeleteWebExperienceProfile("XP-6MSR-MERU-75MJ-SCXL") | ||
//fmt.Println(err) | ||
//var err = client.DeleteWebExperienceProfile("XP-6MSR-MERU-75MJ-SCXL") | ||
//t.Log(err) | ||
} | ||
|
||
func TestPayPal_GetWebhookDetails(t *testing.T) { | ||
//var webhook, err = paypal.GetWebExperienceProfileDetails("XP-BEFQ-A67P-RNXQ-LJLM") | ||
//if err != nil { | ||
// t.Fatal(err) | ||
//} | ||
//fmt.Println(webhook.Id, webhook.Name) | ||
var webhook, err = client.GetWebExperienceProfileDetails("XP-BEFQ-A67P-RNXQ-LJLM") | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
t.Log(webhook.Id, webhook.Name) | ||
} |
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
Oops, something went wrong.