-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable retail outlet by using xendit invoice
Signed-off-by: Imre Nagi <imre.nagi@go-jek.com>
- Loading branch information
Imre Nagi
committed
May 27, 2020
1 parent
011d457
commit 9f6f3e9
Showing
3 changed files
with
28 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package xendit | ||
|
||
import ( | ||
xinvoice "github.com/xendit/xendit-go/invoice" | ||
) | ||
|
||
func NewAlfamartInvoice(rb *InvoiceRequestBuilder) (*AlfamartInvoice, error) { | ||
return &AlfamartInvoice{ | ||
rb: rb, | ||
}, nil | ||
} | ||
|
||
type AlfamartInvoice struct { | ||
rb *InvoiceRequestBuilder | ||
} | ||
|
||
func (o *AlfamartInvoice) Build() (*xinvoice.CreateParams, error) { | ||
o.rb.AddPaymentMethod("ALFAMART") | ||
req, err := o.rb.Build() | ||
if err != nil { | ||
return nil, err | ||
} | ||
return req, nil | ||
} |
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