Initial Marktplaats SDK scaffold
Clone the twdehands SDK into mrktplaats and retarget naming and defaults for app.marktplaats.nl while keeping the same request/response bodies and endpoint behavior.
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
package mrktplaats
|
||||
|
||||
import "context"
|
||||
|
||||
// PaymentService handles payment cart operations.
|
||||
type PaymentService struct {
|
||||
t *transport
|
||||
}
|
||||
|
||||
// PaymentCartCountResponse contains the number of items in the payment cart.
|
||||
type PaymentCartCountResponse struct {
|
||||
UserID string `json:"userId"`
|
||||
NumberOfItems int `json:"numberOfItems"`
|
||||
}
|
||||
|
||||
// CartItemCount returns the number of items in the payment cart.
|
||||
func (s *PaymentService) CartItemCount(ctx context.Context) (*PaymentCartCountResponse, error) {
|
||||
var resp PaymentCartCountResponse
|
||||
if err := s.t.get(ctx, "/app/payments/v3/payment-cart/number-of-items", nil, &resp); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resp, nil
|
||||
}
|
||||
Reference in New Issue
Block a user