diff --git a/.github/workflows/generate-release-tag.yml b/.github/workflows/generate-release-tag.yml index 4e095204..529c6e76 100644 --- a/.github/workflows/generate-release-tag.yml +++ b/.github/workflows/generate-release-tag.yml @@ -4,16 +4,67 @@ on: types: [create-release-tag] jobs: - build: + testing: runs-on: ubuntu-latest + strategy: + matrix: + go-version: ["1.18", "1.19", "1.20"] + steps: - uses: actions/checkout@v3 + + - name: Setup go + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go-version}} + + - name: Print current golang version + run: echo go version + + - name: Install dependencies + run: go get github.com/joho/godotenv + + - name: Run Test + run: DEVELOPMENT_API_KEY=${{ secrets.DEVELOPMENT_API_KEY }} go test ./test -v + + send-test-result: + name: Slack Notification + needs: [testing] + if: always() && (needs.testing.result == 'success' || needs.testing.result == 'failure') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set Slack Color + id: set_color + run: | + if [ "${{ needs.testing.result }}" == "success" ]; then + echo "color=good" >> $GITHUB_ENV + else + echo "color=danger" >> $GITHUB_ENV + fi + + - name: Send Slack Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_TITLE: "[xendi-go] CI pipeline for ${{ github.event.client_payload.version }}" + SLACK_MESSAGE: 'Test Result: ${{ needs.testing.result }}' + SLACK_COLOR: ${{ steps.set_color.outputs.color }} + + publish-release-tag: + runs-on: ubuntu-latest + needs: [testing] + steps: + - uses: actions/checkout@v3 + - name: Set the value in bash id: parse-changelog run: | echo "changelog<> "$GITHUB_OUTPUT" echo "${{ github.event.client_payload.changelog }}" | sed -e 's/%0A/\n/g' >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" + - name: Create Release id: create-release uses: actions/create-release@latest @@ -24,4 +75,4 @@ jobs: release_name: ${{ github.event.client_payload.version }} body: ${{ steps.parse-changelog.outputs.changelog }} draft: false - prerelease: false \ No newline at end of file + prerelease: false diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index a0aadd5c..e4635926 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -15,6 +15,8 @@ docs/refund/CreateRefund409Response.md docs/refund/CreateRefund503Response.md docs/refund/GetAllRefundsDefaultResponse.md docs/refund/Refund.md +docs/refund/RefundCallback.md +docs/refund/RefundCallbackData.md docs/refund/RefundList.md go.mod go.sum @@ -28,6 +30,8 @@ refund/model_create_refund_409_response.go refund/model_create_refund_503_response.go refund/model_get_all_refunds_default_response.go refund/model_refund.go +refund/model_refund_callback.go +refund/model_refund_callback_data.go refund/model_refund_list.go refund/nullable.go response.go diff --git a/README.md b/README.md index 6b762dde..dfd0c9cb 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The official Xendit Go SDK provides a simple and convenient way to call Xendit's REST API in applications written in Go. -* Package version: 3.6.0 +* Package version: 3.7.0 # Getting Started diff --git a/balance_and_transaction/model_balance.go b/balance_and_transaction/model_balance.go index cf5ccfc2..02e0d91d 100644 --- a/balance_and_transaction/model_balance.go +++ b/balance_and_transaction/model_balance.go @@ -3,7 +3,7 @@ Transaction Service V4 API # Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint -API version: 3.5.0 +API version: 3.5.2 */ diff --git a/balance_and_transaction/model_channels_categories.go b/balance_and_transaction/model_channels_categories.go index 0d66c367..6a73a01c 100644 --- a/balance_and_transaction/model_channels_categories.go +++ b/balance_and_transaction/model_channels_categories.go @@ -3,7 +3,7 @@ Transaction Service V4 API # Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint -API version: 3.5.0 +API version: 3.5.2 */ diff --git a/balance_and_transaction/model_currency.go b/balance_and_transaction/model_currency.go index 3bc41b61..fb1deba0 100644 --- a/balance_and_transaction/model_currency.go +++ b/balance_and_transaction/model_currency.go @@ -3,7 +3,7 @@ Transaction Service V4 API # Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint -API version: 3.5.0 +API version: 3.5.2 */ diff --git a/balance_and_transaction/model_date_range_filter.go b/balance_and_transaction/model_date_range_filter.go index 7dab038a..8bd9632a 100644 --- a/balance_and_transaction/model_date_range_filter.go +++ b/balance_and_transaction/model_date_range_filter.go @@ -3,7 +3,7 @@ Transaction Service V4 API # Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint -API version: 3.5.0 +API version: 3.5.2 */ diff --git a/balance_and_transaction/model_fee_response.go b/balance_and_transaction/model_fee_response.go index 699589a0..34d90b5b 100644 --- a/balance_and_transaction/model_fee_response.go +++ b/balance_and_transaction/model_fee_response.go @@ -3,7 +3,7 @@ Transaction Service V4 API # Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint -API version: 3.5.0 +API version: 3.5.2 */ diff --git a/balance_and_transaction/model_link_item.go b/balance_and_transaction/model_link_item.go index a950916c..567e33f5 100644 --- a/balance_and_transaction/model_link_item.go +++ b/balance_and_transaction/model_link_item.go @@ -3,7 +3,7 @@ Transaction Service V4 API # Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint -API version: 3.5.0 +API version: 3.5.2 */ diff --git a/balance_and_transaction/model_server_error.go b/balance_and_transaction/model_server_error.go index 168f88fd..3670b9bb 100644 --- a/balance_and_transaction/model_server_error.go +++ b/balance_and_transaction/model_server_error.go @@ -3,7 +3,7 @@ Transaction Service V4 API # Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint -API version: 3.5.0 +API version: 3.5.2 */ diff --git a/balance_and_transaction/model_transaction_response.go b/balance_and_transaction/model_transaction_response.go index 00750f23..f9c42885 100644 --- a/balance_and_transaction/model_transaction_response.go +++ b/balance_and_transaction/model_transaction_response.go @@ -3,7 +3,7 @@ Transaction Service V4 API # Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint -API version: 3.5.0 +API version: 3.5.2 */ diff --git a/balance_and_transaction/model_transaction_response_type.go b/balance_and_transaction/model_transaction_response_type.go index 4864dd0c..1da0bc06 100644 --- a/balance_and_transaction/model_transaction_response_type.go +++ b/balance_and_transaction/model_transaction_response_type.go @@ -3,7 +3,7 @@ Transaction Service V4 API # Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint -API version: 3.5.0 +API version: 3.5.2 */ diff --git a/balance_and_transaction/model_transaction_statuses.go b/balance_and_transaction/model_transaction_statuses.go index 45b151cd..ac1142ab 100644 --- a/balance_and_transaction/model_transaction_statuses.go +++ b/balance_and_transaction/model_transaction_statuses.go @@ -3,7 +3,7 @@ Transaction Service V4 API # Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint -API version: 3.5.0 +API version: 3.5.2 */ diff --git a/balance_and_transaction/model_transaction_types.go b/balance_and_transaction/model_transaction_types.go index d481edb3..e608c0df 100644 --- a/balance_and_transaction/model_transaction_types.go +++ b/balance_and_transaction/model_transaction_types.go @@ -3,7 +3,7 @@ Transaction Service V4 API # Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint -API version: 3.5.0 +API version: 3.5.2 */ diff --git a/balance_and_transaction/model_transactions_response.go b/balance_and_transaction/model_transactions_response.go index bcaca9f5..b4132ecc 100644 --- a/balance_and_transaction/model_transactions_response.go +++ b/balance_and_transaction/model_transactions_response.go @@ -3,7 +3,7 @@ Transaction Service V4 API # Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint -API version: 3.5.0 +API version: 3.5.2 */ diff --git a/balance_and_transaction/model_validation_error.go b/balance_and_transaction/model_validation_error.go index 4aed40f8..1fcb7608 100644 --- a/balance_and_transaction/model_validation_error.go +++ b/balance_and_transaction/model_validation_error.go @@ -3,7 +3,7 @@ Transaction Service V4 API # Introduction This specification describes how to use the Transaction Service V4 API. **Transaction Service** is the service that records the customer transactions and is responsible to calculate their balance. All products that move customer money around whether it is money-in, money-out, or transfer will interact with the Transaction Service on its flow. Transaction Service is the source of truth of Xendit and Customer regarding how much money that customer has that is stored in Xendit. Transaction Service is the source that is used for both our internal and customer financial reconciliation. Internally, the Transaction Service data structure is similar to how double-entry accounting works. ## How Xendit teams/services do integrate with Transaction Service V4 **Channel product team/service** They interact with the Transaction Service when they want to record the transactions. This transaction can be money-in (balance added), money-out (balance deducted), transfer, refund/void/reversal, or other kind of transaction that affects customer balance. Product team also interacts with the Transaction Service for getting information about the transaction or balance. **Billing/Fee team/service** They interact with Transaction Service either as the dependency of Transaction Service for getting the correct fee calculation/settings. Or using Transaction Service for getting the transaction/fee information to calculate the bill for the customer. **NUX team/service** They interact with the Transaction Service to set up the customer ledger_account that is used to record their transactions. **Finance team/service** They interact with the Transaction Service to get the transaction and balance data for each customer to do reconciliation. **Dashboard/API team/service** They interact with the Transaction Service as a proxy to show the data to the Customer. ## Prerequisites Before staring to use **Transaction Service API** you need to complete a few things: 1. Find out **Base URL** for the API. Every endpoint definition in this document contains list of available servers (local, staging, production) 2. Set up ledger accounts using business id and currency. **Ledger Account** represents the account of the customer that will be used to associate with ledger lines. Each business may have at least 1 ledger account group (a group consists of a few accounts of types such as cash, liability, holding), and the money movement of their ledger will revolve around those ledger accounts. **Ledger Lines** that show a debit or credit transaction for a ledger account. We’re using the double-entry principle in accounting where we should post 2 lines every time we make a transaction, 1 to debit an account and 1 to credit another account. See how to call Create cash, liability, holding, and tax account for a business (api/ledger-accounts/setup) section of this document 3. To be able to create payments with fee/VAT the Product rate settings and VAT rate settings should be created using Transaction Fee Service. See Fee Service Documentation for details about how to create Product/VAT rate settings. ## Transaction flows To integrate with the Transaction Service you should decide what types of transaction flows your integration will be using. Transaction flow is set by the transaction `type` during transaction creation 1. Money In flows 1. Payment from credit card `type: CREDIT_CARD_PAYMENT` 3. Payment from other sources without fee/VAT `type: DEPOSIT, FOREX_DEPOSIT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, BATCH_VA_PAYMENT` 4. Payment from other sources with fee/VAT `type: VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, RO_PAYMENT, EWALLET_PAYMENT, CARDLESS_CREDIT_PAYMENT, IM_REMITTANCE_VA_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CRYPTO_PAYMENT` 5. Billing deposit from cash `type: BILLING_DEPOSIT` 6. Billing deposit from other sources `type: BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT` 2. Money out flows 1. Instant payment `type: simple money out types` `status: COMPLETED` 2. Simple payment without fee/VAT `type: CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, FOREX_DEDUCTION, BNPL_PARTNER_SETTLEMENT_DEBIT, WITHDRAWAL` 3. Simple payment with fee/VAT `type: ISSUING_FUNDING, BATCH_DISBURSEMENT, CASH_DISBURSEMENT, DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT` 4. Billing withdraw to cash `type: BILLING_WITHDRAWAL` 4. Billing withdraw to other destinations `type: BILL_PAYMENT` 3. Reversal flow Some of transactions could be reversed. See Reversible / non reversible transaction types section of this document. To reverse transaction you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `REVERSED`. 4. Void/Cancellation Flow Transaction in the `PENDING_SETTLEMENT` status could be canceled. To do that you should call Update transaction (/api/transactions/:id) endpoint with the transaction status `VOIDED`. 5. Switcher flow Switchers are transactions that do not affect the customer balance. These are transactions that goes directly to the customers’ account and simply passes through Xendit. Therefore, it will not impact the customer balance and we will only charge Fee and VAT. To create switcher flow you should set `is_switcher_payment` field to `true`. ## Instant/non instant settlement Transactions can be performed instantly (instant settlement) or with delay (non instant settlement). Some of the transaction types are only instantly processed, some of them support both instant and non instant settlement and some of them have only non instant settlement. If settlement is instant than balance will be changed instantly. In opposite case the transaction status has to be set into PENDING_SETTLEMENT and settlement date should be provided. 1. Instant settlement Money In transaction types `DEPOSIT, BATCH_VA_PAYMENT, FOREX_DEPOSIT, IM_DEPOSIT, CARDLESS_CREDIT_PAYMENT, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_CREDIT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK, REMITTANCE_VA_PAYMENT_CLAIM` 2. Both instant and non instant Money In transaction types `DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, RO_PAYMENT, EWALLET_PAYMENT, QR_CODE_PAYMENT, VA_PAYMENT, INVOICE, PAYLATER_PAYMENT` 3. Non Instant settlement Money In transaction types `CREDIT_CARD_PAYMENT` 4. Instant settlement Money Out transaction types `LOAN_REPAYMENT, FOREX_DEDUCTION, BILL_PAYMENT, ISSUING_FUNDING, BNPL_PARTNER_SETTLEMENT_DEBIT, FRAUD_DEDUCTION` 5. Both instant and non instant settlement supported Money Out transaction types `CHARGEBACK_DEDUCTION` 6. Non Instant settlement Money Out transaction types All other money out types are non instant settlement ## Reversible / non reversible transaction types Some transactions can be reversed. Here are the list of transaction types that could be reversed: `CASH_DISBURSEMENT, DISBURSEMENT, BATCH_DISBURSEMENT, REMITTANCE, REMITTANCE_PAYOUT, TAX_DISBURSEMENT, WITHDRAWAL, DEPOSIT, FOREX_DEPOSIT, FOREX_DEDUCTION, VA_PAYMENT, BATCH_VA_PAYMENT, IM_REMITTANCE_VA_PAYMENT, IM_ESCROW_VA_PAYMENT, IM_DEPOSIT, REMITTANCE_VA_PAYMENT, REMITTANCE_VA_PAYMENT_CLAIM, RO_PAYMENT, CARDLESS_CREDIT_PAYMENT, PAYLATER_PAYMENT, INVOICE, QR_CODE_PAYMENT, CREDIT_CARD_PAYMENT, EWALLET_PAYMENT, DIRECT_DEBIT_PAYMENT, DIRECT_BANK_TRANSFER, ACH_PAYMENT, CHARGEBACK_DEDUCTION, FRAUD_DEDUCTION, LOAN_REPAYMENT, ISSUING_FUNDING, ISSUING_FUNDING_REFUND, BNPL_PARTNER_SETTLEMENT_DEBIT, BNPL_PARTNER_SETTLEMENT_CREDIT, BILLING_DEPOSIT, BILLING_DIRECT_DEPOSIT, BILLING_VA_DIRECT_DEPOSIT, BILLING_WITHDRAWAL, BILL_PAYMENT, PROMO_FEE_CASHBACK, PROMO_VAT_CASHBACK` ## How to create transaction After you created or already have the `BUSINESS_CASH` ledger account ID (See Prerequisites section) and you know what transaction flows are going to be used you can create the new transaction using POST request to the Create a new transaction (/api/transactions) endpoint ## How to update transaction To update transaction you should do PATCH request to the Update transaction (/api/transactions/::id) endpoint -API version: 3.5.0 +API version: 3.5.2 */ diff --git a/client.go b/client.go index a1557db1..42ec43f1 100644 --- a/client.go +++ b/client.go @@ -154,7 +154,7 @@ func (c *APIClient) PrepareRequest( headerParams["xendit-lib"] = "go" // TODO: overwrite this line from buddy pipeline - headerParams["xendit-lib-ver"] = "3.6.0" + headerParams["xendit-lib-ver"] = "3.7.0" var body *bytes.Buffer diff --git a/configuration.go b/configuration.go index a049b9a0..edd29d26 100644 --- a/configuration.go +++ b/configuration.go @@ -78,7 +78,7 @@ var Default Configuration = *NewConfiguration() func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/3.6.0/go", + UserAgent: "OpenAPI-Generator/3.7.0/go", Debug: false, Servers: ServerConfigurations{ { diff --git a/docs/BalanceApi.md b/docs/BalanceApi.md index 6f4017bf..a8ccafd7 100644 --- a/docs/BalanceApi.md +++ b/docs/BalanceApi.md @@ -102,4 +102,5 @@ func main() { } ``` + [[Back to README]](../README.md) diff --git a/docs/CustomerApi.md b/docs/CustomerApi.md index 99517b13..d724918f 100644 --- a/docs/CustomerApi.md +++ b/docs/CustomerApi.md @@ -314,4 +314,5 @@ func main() { } ``` + [[Back to README]](../README.md) diff --git a/docs/InvoiceApi.md b/docs/InvoiceApi.md index ff77711a..fcc5341a 100644 --- a/docs/InvoiceApi.md +++ b/docs/InvoiceApi.md @@ -72,7 +72,7 @@ func main() { createInvoiceRequest := *invoice.NewCreateInvoiceRequest("ExternalId_example", float32(123)) // [REQUIRED] | CreateInvoiceRequest // Business ID of the sub-account merchant (XP feature) - forUserId := "62efe4c33e45694d63f585f8" // [OPTIONAL] | string + forUserId := "62efe4c33e45694d63f585f0" // [OPTIONAL] | string xenditClient := xendit.NewClient("API-KEY") @@ -141,7 +141,7 @@ func main() { invoiceId := "62efe4c33e45294d63f585f2" // [REQUIRED] | string // Business ID of the sub-account merchant (XP feature) - forUserId := "62efe4c33e45694d63f585f8" // [OPTIONAL] | string + forUserId := "62efe4c33e45694d63f585f0" // [OPTIONAL] | string xenditClient := xendit.NewClient("API-KEY") @@ -216,7 +216,7 @@ import ( func main() { // Business ID of the sub-account merchant (XP feature) - forUserId := "62efe4c33e45694d63f585f8" // [OPTIONAL] | string + forUserId := "62efe4c33e45694d63f585f0" // [OPTIONAL] | string externalId := "test-external" // [OPTIONAL] | string @@ -326,7 +326,7 @@ func main() { invoiceId := "5f4708b7bd394b0400b96276" // [REQUIRED] | string // Business ID of the sub-account merchant (XP feature) - forUserId := "62efe4c33e45694d63f585f8" // [OPTIONAL] | string + forUserId := "62efe4c33e45694d63f585f0" // [OPTIONAL] | string xenditClient := xendit.NewClient("API-KEY") @@ -347,4 +347,60 @@ func main() { } ``` +## Callback Objects +Use the following callback objects provided by Xendit to receive callbacks (also known as webhooks) that Xendit sends you on events, such as successful payments. Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice +### InvoiceCallback Object +>Invoice Callback Object + +Model Documentation: [InvoiceCallback](/InvoiceCallback.md) +#### Usage Example +Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice +```go +InvoiceCallbackJson := map[string]interface{}{ + "id" : "593f4ed1c3d3bb7f39733d83", + "external_id" : "testing-invoice", + "user_id" : "5848fdf860053555135587e7", + "payment_method" : "RETAIL_OUTLET", + "status" : "PAID", + "merchant_name" : "Xendit", + "amount" : 2000000, + "paid_amount" : 2000000, + "paid_at" : "2020-01-14T02:32:50.912Z", + "payer_email" : "test@xendit.co", + "description" : "Invoice webhook test", + "created" : "2020-01-13T02:32:49.827Z", + "updated" : "2020-01-13T02:32:50.912Z", + "currency" : "IDR", + "payment_channel" : "ALFAMART", + "payment_destination" : "TEST815" +} +jsonData, _ := json.Marshal(InvoiceCallbackJson) +``` + +You may then use the callback object in your webhook or callback handler like so, +```go +package main + +import ( + "encoding/json" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + invoice "github.com/xendit/xendit-go/v3/invoice" +) + +func main() { + // get callback object here + // define jsonData + + // unmarshal callback object jsonData + var InvoiceCallback invoice.InvoiceCallback + err := json.Unmarshal(jsonData, &InvoiceCallback) + if err == nil { + fmt.Fprintf(os.Stdout, "Callback Object ID: %v\n", InvoiceCallback.GetId()) + // do things here with the callback + } +} +``` + [[Back to README]](../README.md) diff --git a/docs/PaymentMethodApi.md b/docs/PaymentMethodApi.md index 512a452b..2d85d0d1 100644 --- a/docs/PaymentMethodApi.md +++ b/docs/PaymentMethodApi.md @@ -663,4 +663,81 @@ func main() { } ``` +## Callback Objects +Use the following callback objects provided by Xendit to receive callbacks (also known as webhooks) that Xendit sends you on events, such as successful payments. Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice +### PaymentMethodCallback Object +>Callback for active or expired E-Wallet or Direct Debit account linking, Virtual Accounts or QR strings + +Model Documentation: [PaymentMethodCallback](/PaymentMethodCallback.md) +#### Usage Example +Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice +```go +PaymentMethodCallbackJson := map[string]interface{}{ + "event" : "payment_method.activated", + "data" : { + "id" : "pm-6ff0b6f2-f5de-457f-b08f-bc98fbae485a", + "card" : null, + "type" : "DIRECT_DEBIT", + "status" : "ACTIVE", + "country" : "PH", + "created" : "2022-08-12T13:30:26.579048Z", + "ewallet" : null, + "qr_code" : null, + "updated" : "2022-08-12T13:30:58.908220358Z", + "metadata" : null, + "customer_id" : "e2878b4c-d57e-4a2c-922d-c0313c2800a3", + "description" : null, + "reusability" : "MULTIPLE_USE", + "direct_debit" : { + "type" : "BANK_ACCOUNT", + "debit_card" : null, + "bank_account" : { + "bank_account_hash" : "b4dfa99c9b60c77f2e3962b73c098945", + "masked_bank_account_number" : "XXXXXX1234" + }, + "channel_code" : "BPI", + "channel_properties" : { + "failure_return_url" : "https://your-redirect-website.com/failure", + "success_return_url" : "https://your-redirect-website.com/success" + } + }, + "failure_code" : null, + "reference_id" : "620b9df4-fe69-4bfd-b9d4-5cba6861db8a", + "virtual_account" : null, + "over_the_counter" : null, + "billing_information" : null, + "direct_bank_transfer" : null + }, + "created" : "2022-08-12T13:30:59.074277334Z", + "business_id" : "5f27a14a9bf05c73dd040bc8" +} +jsonData, _ := json.Marshal(PaymentMethodCallbackJson) +``` + +You may then use the callback object in your webhook or callback handler like so, +```go +package main + +import ( + "encoding/json" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_method "github.com/xendit/xendit-go/v3/payment_method" +) + +func main() { + // get callback object here + // define jsonData + + // unmarshal callback object jsonData + var PaymentMethodCallback payment_method.PaymentMethodCallback + err := json.Unmarshal(jsonData, &PaymentMethodCallback) + if err == nil { + fmt.Fprintf(os.Stdout, "Callback Object ID: %v\n", PaymentMethodCallback.GetId()) + // do things here with the callback + } +} +``` + [[Back to README]](../README.md) diff --git a/docs/PaymentRequestApi.md b/docs/PaymentRequestApi.md index d892f7f9..831dce2b 100644 --- a/docs/PaymentRequestApi.md +++ b/docs/PaymentRequestApi.md @@ -539,4 +539,99 @@ func main() { } ``` +## Callback Objects +Use the following callback objects provided by Xendit to receive callbacks (also known as webhooks) that Xendit sends you on events, such as successful payments. Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice +### PaymentCallback Object +>Callback for successful or failed payments made via the Payments API + +Model Documentation: [PaymentCallback](/PaymentCallback.md) +#### Usage Example +Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice +```go +PaymentCallbackJson := map[string]interface{}{ + "event" : "payment.succeeded", + "data" : { + "id" : "ddpy-3cd658ae-25b9-4659-aa36-596ae41a809f", + "amount" : 1000, + "status" : "SUCCEEDED", + "country" : "PH", + "created" : "2022-08-12T13:30:40.9209Z", + "updated" : "2022-08-12T13:30:58.729373Z", + "currency" : "PHP", + "metadata" : { + "sku" : "ABCDEFGH" + }, + "customer_id" : "c832697e-a62d-46fa-a383-24930b155e81", + "reference_id" : "25cfd0f9-baee-44ca-9a12-6debe03f3c22", + "payment_method" : { + "id" : "pm-951b1ad9-1fbb-4724-a744-8956ab6ed17f", + "card" : null, + "type" : "DIRECT_DEBIT", + "status" : "ACTIVE", + "created" : "2022-08-12T13:30:26.579048Z", + "ewallet" : null, + "qr_code" : null, + "updated" : "2022-08-12T13:30:40.221525Z", + "metadata" : { + "sku" : "ABCDEFGH" + }, + "description" : null, + "reusability" : "MULTIPLE_USE", + "direct_debit" : { + "type" : "BANK_ACCOUNT", + "debit_card" : null, + "bank_account" : { + "bank_account_hash" : "b4dfa99c9b60c77f2e3962b73c098945", + "masked_bank_account_number" : "XXXXXX1234" + }, + "channel_code" : "BPI", + "channel_properties" : { + "failure_return_url" : "https://your-redirect-website.com/failure", + "success_return_url" : "https://your-redirect-website.com/success" + } + }, + "reference_id" : "620b9df4-fe69-4bfd-b9d4-5cba6861db8a", + "virtual_account" : null, + "over_the_counter" : null, + "direct_bank_transfer" : null + }, + "description" : null, + "failure_code" : null, + "payment_detail" : null, + "channel_properties" : null, + "payment_request_id" : "pr-5b26cae1-545b-49e9-855e-f85128f3e705" + }, + "created" : "2022-08-12T13:30:58.986Z", + "business_id" : "5f27a14a9bf05c73dd040bc8", + "api_version" : null +} +jsonData, _ := json.Marshal(PaymentCallbackJson) +``` + +You may then use the callback object in your webhook or callback handler like so, +```go +package main + +import ( + "encoding/json" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + payment_request "github.com/xendit/xendit-go/v3/payment_request" +) + +func main() { + // get callback object here + // define jsonData + + // unmarshal callback object jsonData + var PaymentCallback payment_request.PaymentCallback + err := json.Unmarshal(jsonData, &PaymentCallback) + if err == nil { + fmt.Fprintf(os.Stdout, "Callback Object ID: %v\n", PaymentCallback.GetId()) + // do things here with the callback + } +} +``` + [[Back to README]](../README.md) diff --git a/docs/PayoutApi.md b/docs/PayoutApi.md index 76b3e5bb..b4ca5225 100644 --- a/docs/PayoutApi.md +++ b/docs/PayoutApi.md @@ -402,4 +402,5 @@ func main() { } ``` + [[Back to README]](../README.md) diff --git a/docs/RefundApi.md b/docs/RefundApi.md index 6b66d906..3ccc20df 100644 --- a/docs/RefundApi.md +++ b/docs/RefundApi.md @@ -324,4 +324,64 @@ func main() { } ``` +## Callback Objects +Use the following callback objects provided by Xendit to receive callbacks (also known as webhooks) that Xendit sends you on events, such as successful payments. Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice +### RefundCallback Object +>Callback for successful or failed Refunds made via the Payments API + +Model Documentation: [RefundCallback](/RefundCallback.md) +#### Usage Example +Note that the example is meant to illustrate the contents of the callback object -- you will not need to instantiate these objects in practice +```go +RefundCallbackJson := map[string]interface{}{ + "event" : "refund.succeeded", + "business_id" : "5f27a14a9bf05c73dd040bc8", + "created" : "2020-08-29T09:12:33.001Z", + "data" : { + "id" : "rfd-6f4a377d-a201-437f-9119-f8b00cbbe857", + "payment_id" : "ddpy-3cd658ae-25b9-4659-aa36-596ae41a809f", + "invoice_id" : null, + "amount" : 10000, + "payment_method_type" : "DIRECT_DEBIT", + "channel_code" : "BPI", + "currency" : "PHP", + "status" : "SUCCEEDED", + "reason" : "CANCELLATION", + "reference_id" : "b2756a1e-e6cd-4352-9a68-0483aa2b6a2", + "failure_code" : null, + "refund_fee_amount" : null, + "created" : "2020-08-30T09:12:33.001Z", + "updated" : "2020-08-30T09:12:33.001Z", + "metadata" : null + } +} +jsonData, _ := json.Marshal(RefundCallbackJson) +``` + +You may then use the callback object in your webhook or callback handler like so, +```go +package main + +import ( + "encoding/json" + "fmt" + "os" + xendit "github.com/xendit/xendit-go/v3" + refund "github.com/xendit/xendit-go/v3/refund" +) + +func main() { + // get callback object here + // define jsonData + + // unmarshal callback object jsonData + var RefundCallback refund.RefundCallback + err := json.Unmarshal(jsonData, &RefundCallback) + if err == nil { + fmt.Fprintf(os.Stdout, "Callback Object ID: %v\n", RefundCallback.GetId()) + // do things here with the callback + } +} +``` + [[Back to README]](../README.md) diff --git a/docs/TransactionApi.md b/docs/TransactionApi.md index ea2f3b88..699e7ab0 100644 --- a/docs/TransactionApi.md +++ b/docs/TransactionApi.md @@ -232,4 +232,5 @@ func main() { } ``` + [[Back to README]](../README.md) diff --git a/docs/invoice/InvoiceCallback.md b/docs/invoice/InvoiceCallback.md new file mode 100644 index 00000000..5d120b02 --- /dev/null +++ b/docs/invoice/InvoiceCallback.md @@ -0,0 +1,713 @@ +# InvoiceCallback +Invoice Callback Object + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **Id** | **string** | ☑️ | An invoice ID generated by Xendit | | +| **ExternalId** | **string** | ☑️ | ID of your choice (typically the unique identifier of an invoice in your system) | | +| **UserId** | **string** | ☑️ | Xendit Business ID | | +| **Status** | **string** | ☑️ | The status of the invoice. | | +| **MerchantName** | **string** | ☑️ | The name of company or website | | +| **Amount** | **float32** | ☑️ | Nominal amount for the invoice | | +| **PayerEmail** | Pointer to **string** | | Email of the payer | | +| **Description** | Pointer to **string** | | Description for the invoice | | +| **PaidAmount** | Pointer to **float32** | | Total amount paid for the invoice | | +| **Created** | **string** | ☑️ | The date and time when the invoice was created. | | +| **Updated** | **string** | ☑️ | The date and time when the invoice was last updated. | | +| **Currency** | **string** | ☑️ | The currency of the invoice. | | +| **PaidAt** | Pointer to **string** | | The date and time when the invoice was paid. | | +| **PaymentMethod** | Pointer to **string** | | The payment method used for the invoice. | | +| **PaymentChannel** | Pointer to **string** | | The payment channel. | | +| **PaymentDestination** | Pointer to **string** | | The payment destination. | | +| **PaymentDetails** | Pointer to [**PaymentDetails**](PaymentDetails.md) | | | | +| **PaymentId** | Pointer to **string** | | The ID of the payment. | | +| **SuccessRedirectUrl** | Pointer to **string** | | The URL to redirect to on successful payment. | | +| **FailureRedirectUrl** | Pointer to **string** | | The URL to redirect to on payment failure. | | +| **CreditCardChargeId** | Pointer to **string** | | The ID associated with a credit card charge (if applicable). | | +| **Items** | Pointer to [**InvoiceCallbackItem[]**](InvoiceCallbackItem.md) | | | | +| **Fees** | Pointer to [**InvoiceFee[]**](InvoiceFee.md) | | An array of fees associated with the invoice. | | +| **ShouldAuthenticateCreditCard** | Pointer to **bool** | | Indicates whether credit card authentication is required. | | +| **BankCode** | Pointer to **string** | | The bank code for the bank details. | | +| **EwalletType** | Pointer to **string** | | The type of eWallet. | | +| **OnDemandLink** | Pointer to **string** | | The on-demand link. | | +| **RecurringPaymentId** | Pointer to **string** | | The ID of the recurring payment. | | + +## Methods + +### NewInvoiceCallback + +`func NewInvoiceCallback(id string, externalId string, userId string, status string, merchantName string, amount float32, created string, updated string, currency string, ) *InvoiceCallback` + +NewInvoiceCallback instantiates a new InvoiceCallback object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInvoiceCallbackWithDefaults + +`func NewInvoiceCallbackWithDefaults() *InvoiceCallback` + +NewInvoiceCallbackWithDefaults instantiates a new InvoiceCallback object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *InvoiceCallback) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *InvoiceCallback) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *InvoiceCallback) SetId(v string)` + +SetId sets Id field to given value. + + +### GetExternalId + +`func (o *InvoiceCallback) GetExternalId() string` + +GetExternalId returns the ExternalId field if non-nil, zero value otherwise. + +### GetExternalIdOk + +`func (o *InvoiceCallback) GetExternalIdOk() (*string, bool)` + +GetExternalIdOk returns a tuple with the ExternalId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExternalId + +`func (o *InvoiceCallback) SetExternalId(v string)` + +SetExternalId sets ExternalId field to given value. + + +### GetUserId + +`func (o *InvoiceCallback) GetUserId() string` + +GetUserId returns the UserId field if non-nil, zero value otherwise. + +### GetUserIdOk + +`func (o *InvoiceCallback) GetUserIdOk() (*string, bool)` + +GetUserIdOk returns a tuple with the UserId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUserId + +`func (o *InvoiceCallback) SetUserId(v string)` + +SetUserId sets UserId field to given value. + + +### GetStatus + +`func (o *InvoiceCallback) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *InvoiceCallback) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *InvoiceCallback) SetStatus(v string)` + +SetStatus sets Status field to given value. + + +### GetMerchantName + +`func (o *InvoiceCallback) GetMerchantName() string` + +GetMerchantName returns the MerchantName field if non-nil, zero value otherwise. + +### GetMerchantNameOk + +`func (o *InvoiceCallback) GetMerchantNameOk() (*string, bool)` + +GetMerchantNameOk returns a tuple with the MerchantName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantName + +`func (o *InvoiceCallback) SetMerchantName(v string)` + +SetMerchantName sets MerchantName field to given value. + + +### GetAmount + +`func (o *InvoiceCallback) GetAmount() float32` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *InvoiceCallback) GetAmountOk() (*float32, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *InvoiceCallback) SetAmount(v float32)` + +SetAmount sets Amount field to given value. + + +### GetPayerEmail + +`func (o *InvoiceCallback) GetPayerEmail() string` + +GetPayerEmail returns the PayerEmail field if non-nil, zero value otherwise. + +### GetPayerEmailOk + +`func (o *InvoiceCallback) GetPayerEmailOk() (*string, bool)` + +GetPayerEmailOk returns a tuple with the PayerEmail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPayerEmail + +`func (o *InvoiceCallback) SetPayerEmail(v string)` + +SetPayerEmail sets PayerEmail field to given value. + +### HasPayerEmail + +`func (o *InvoiceCallback) HasPayerEmail() bool` + +HasPayerEmail returns a boolean if a field has been set. + +### GetDescription + +`func (o *InvoiceCallback) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *InvoiceCallback) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *InvoiceCallback) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *InvoiceCallback) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetPaidAmount + +`func (o *InvoiceCallback) GetPaidAmount() float32` + +GetPaidAmount returns the PaidAmount field if non-nil, zero value otherwise. + +### GetPaidAmountOk + +`func (o *InvoiceCallback) GetPaidAmountOk() (*float32, bool)` + +GetPaidAmountOk returns a tuple with the PaidAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaidAmount + +`func (o *InvoiceCallback) SetPaidAmount(v float32)` + +SetPaidAmount sets PaidAmount field to given value. + +### HasPaidAmount + +`func (o *InvoiceCallback) HasPaidAmount() bool` + +HasPaidAmount returns a boolean if a field has been set. + +### GetCreated + +`func (o *InvoiceCallback) GetCreated() string` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *InvoiceCallback) GetCreatedOk() (*string, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *InvoiceCallback) SetCreated(v string)` + +SetCreated sets Created field to given value. + + +### GetUpdated + +`func (o *InvoiceCallback) GetUpdated() string` + +GetUpdated returns the Updated field if non-nil, zero value otherwise. + +### GetUpdatedOk + +`func (o *InvoiceCallback) GetUpdatedOk() (*string, bool)` + +GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdated + +`func (o *InvoiceCallback) SetUpdated(v string)` + +SetUpdated sets Updated field to given value. + + +### GetCurrency + +`func (o *InvoiceCallback) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *InvoiceCallback) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *InvoiceCallback) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + + +### GetPaidAt + +`func (o *InvoiceCallback) GetPaidAt() string` + +GetPaidAt returns the PaidAt field if non-nil, zero value otherwise. + +### GetPaidAtOk + +`func (o *InvoiceCallback) GetPaidAtOk() (*string, bool)` + +GetPaidAtOk returns a tuple with the PaidAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaidAt + +`func (o *InvoiceCallback) SetPaidAt(v string)` + +SetPaidAt sets PaidAt field to given value. + +### HasPaidAt + +`func (o *InvoiceCallback) HasPaidAt() bool` + +HasPaidAt returns a boolean if a field has been set. + +### GetPaymentMethod + +`func (o *InvoiceCallback) GetPaymentMethod() string` + +GetPaymentMethod returns the PaymentMethod field if non-nil, zero value otherwise. + +### GetPaymentMethodOk + +`func (o *InvoiceCallback) GetPaymentMethodOk() (*string, bool)` + +GetPaymentMethodOk returns a tuple with the PaymentMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethod + +`func (o *InvoiceCallback) SetPaymentMethod(v string)` + +SetPaymentMethod sets PaymentMethod field to given value. + +### HasPaymentMethod + +`func (o *InvoiceCallback) HasPaymentMethod() bool` + +HasPaymentMethod returns a boolean if a field has been set. + +### GetPaymentChannel + +`func (o *InvoiceCallback) GetPaymentChannel() string` + +GetPaymentChannel returns the PaymentChannel field if non-nil, zero value otherwise. + +### GetPaymentChannelOk + +`func (o *InvoiceCallback) GetPaymentChannelOk() (*string, bool)` + +GetPaymentChannelOk returns a tuple with the PaymentChannel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentChannel + +`func (o *InvoiceCallback) SetPaymentChannel(v string)` + +SetPaymentChannel sets PaymentChannel field to given value. + +### HasPaymentChannel + +`func (o *InvoiceCallback) HasPaymentChannel() bool` + +HasPaymentChannel returns a boolean if a field has been set. + +### GetPaymentDestination + +`func (o *InvoiceCallback) GetPaymentDestination() string` + +GetPaymentDestination returns the PaymentDestination field if non-nil, zero value otherwise. + +### GetPaymentDestinationOk + +`func (o *InvoiceCallback) GetPaymentDestinationOk() (*string, bool)` + +GetPaymentDestinationOk returns a tuple with the PaymentDestination field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentDestination + +`func (o *InvoiceCallback) SetPaymentDestination(v string)` + +SetPaymentDestination sets PaymentDestination field to given value. + +### HasPaymentDestination + +`func (o *InvoiceCallback) HasPaymentDestination() bool` + +HasPaymentDestination returns a boolean if a field has been set. + +### GetPaymentDetails + +`func (o *InvoiceCallback) GetPaymentDetails() PaymentDetails` + +GetPaymentDetails returns the PaymentDetails field if non-nil, zero value otherwise. + +### GetPaymentDetailsOk + +`func (o *InvoiceCallback) GetPaymentDetailsOk() (*PaymentDetails, bool)` + +GetPaymentDetailsOk returns a tuple with the PaymentDetails field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentDetails + +`func (o *InvoiceCallback) SetPaymentDetails(v PaymentDetails)` + +SetPaymentDetails sets PaymentDetails field to given value. + +### HasPaymentDetails + +`func (o *InvoiceCallback) HasPaymentDetails() bool` + +HasPaymentDetails returns a boolean if a field has been set. + +### GetPaymentId + +`func (o *InvoiceCallback) GetPaymentId() string` + +GetPaymentId returns the PaymentId field if non-nil, zero value otherwise. + +### GetPaymentIdOk + +`func (o *InvoiceCallback) GetPaymentIdOk() (*string, bool)` + +GetPaymentIdOk returns a tuple with the PaymentId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentId + +`func (o *InvoiceCallback) SetPaymentId(v string)` + +SetPaymentId sets PaymentId field to given value. + +### HasPaymentId + +`func (o *InvoiceCallback) HasPaymentId() bool` + +HasPaymentId returns a boolean if a field has been set. + +### GetSuccessRedirectUrl + +`func (o *InvoiceCallback) GetSuccessRedirectUrl() string` + +GetSuccessRedirectUrl returns the SuccessRedirectUrl field if non-nil, zero value otherwise. + +### GetSuccessRedirectUrlOk + +`func (o *InvoiceCallback) GetSuccessRedirectUrlOk() (*string, bool)` + +GetSuccessRedirectUrlOk returns a tuple with the SuccessRedirectUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccessRedirectUrl + +`func (o *InvoiceCallback) SetSuccessRedirectUrl(v string)` + +SetSuccessRedirectUrl sets SuccessRedirectUrl field to given value. + +### HasSuccessRedirectUrl + +`func (o *InvoiceCallback) HasSuccessRedirectUrl() bool` + +HasSuccessRedirectUrl returns a boolean if a field has been set. + +### GetFailureRedirectUrl + +`func (o *InvoiceCallback) GetFailureRedirectUrl() string` + +GetFailureRedirectUrl returns the FailureRedirectUrl field if non-nil, zero value otherwise. + +### GetFailureRedirectUrlOk + +`func (o *InvoiceCallback) GetFailureRedirectUrlOk() (*string, bool)` + +GetFailureRedirectUrlOk returns a tuple with the FailureRedirectUrl field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureRedirectUrl + +`func (o *InvoiceCallback) SetFailureRedirectUrl(v string)` + +SetFailureRedirectUrl sets FailureRedirectUrl field to given value. + +### HasFailureRedirectUrl + +`func (o *InvoiceCallback) HasFailureRedirectUrl() bool` + +HasFailureRedirectUrl returns a boolean if a field has been set. + +### GetCreditCardChargeId + +`func (o *InvoiceCallback) GetCreditCardChargeId() string` + +GetCreditCardChargeId returns the CreditCardChargeId field if non-nil, zero value otherwise. + +### GetCreditCardChargeIdOk + +`func (o *InvoiceCallback) GetCreditCardChargeIdOk() (*string, bool)` + +GetCreditCardChargeIdOk returns a tuple with the CreditCardChargeId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreditCardChargeId + +`func (o *InvoiceCallback) SetCreditCardChargeId(v string)` + +SetCreditCardChargeId sets CreditCardChargeId field to given value. + +### HasCreditCardChargeId + +`func (o *InvoiceCallback) HasCreditCardChargeId() bool` + +HasCreditCardChargeId returns a boolean if a field has been set. + +### GetItems + +`func (o *InvoiceCallback) GetItems() []InvoiceCallbackItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *InvoiceCallback) GetItemsOk() (*[]InvoiceCallbackItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *InvoiceCallback) SetItems(v []InvoiceCallbackItem)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *InvoiceCallback) HasItems() bool` + +HasItems returns a boolean if a field has been set. + +### GetFees + +`func (o *InvoiceCallback) GetFees() []InvoiceFee` + +GetFees returns the Fees field if non-nil, zero value otherwise. + +### GetFeesOk + +`func (o *InvoiceCallback) GetFeesOk() (*[]InvoiceFee, bool)` + +GetFeesOk returns a tuple with the Fees field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFees + +`func (o *InvoiceCallback) SetFees(v []InvoiceFee)` + +SetFees sets Fees field to given value. + +### HasFees + +`func (o *InvoiceCallback) HasFees() bool` + +HasFees returns a boolean if a field has been set. + +### GetShouldAuthenticateCreditCard + +`func (o *InvoiceCallback) GetShouldAuthenticateCreditCard() bool` + +GetShouldAuthenticateCreditCard returns the ShouldAuthenticateCreditCard field if non-nil, zero value otherwise. + +### GetShouldAuthenticateCreditCardOk + +`func (o *InvoiceCallback) GetShouldAuthenticateCreditCardOk() (*bool, bool)` + +GetShouldAuthenticateCreditCardOk returns a tuple with the ShouldAuthenticateCreditCard field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShouldAuthenticateCreditCard + +`func (o *InvoiceCallback) SetShouldAuthenticateCreditCard(v bool)` + +SetShouldAuthenticateCreditCard sets ShouldAuthenticateCreditCard field to given value. + +### HasShouldAuthenticateCreditCard + +`func (o *InvoiceCallback) HasShouldAuthenticateCreditCard() bool` + +HasShouldAuthenticateCreditCard returns a boolean if a field has been set. + +### GetBankCode + +`func (o *InvoiceCallback) GetBankCode() string` + +GetBankCode returns the BankCode field if non-nil, zero value otherwise. + +### GetBankCodeOk + +`func (o *InvoiceCallback) GetBankCodeOk() (*string, bool)` + +GetBankCodeOk returns a tuple with the BankCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBankCode + +`func (o *InvoiceCallback) SetBankCode(v string)` + +SetBankCode sets BankCode field to given value. + +### HasBankCode + +`func (o *InvoiceCallback) HasBankCode() bool` + +HasBankCode returns a boolean if a field has been set. + +### GetEwalletType + +`func (o *InvoiceCallback) GetEwalletType() string` + +GetEwalletType returns the EwalletType field if non-nil, zero value otherwise. + +### GetEwalletTypeOk + +`func (o *InvoiceCallback) GetEwalletTypeOk() (*string, bool)` + +GetEwalletTypeOk returns a tuple with the EwalletType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEwalletType + +`func (o *InvoiceCallback) SetEwalletType(v string)` + +SetEwalletType sets EwalletType field to given value. + +### HasEwalletType + +`func (o *InvoiceCallback) HasEwalletType() bool` + +HasEwalletType returns a boolean if a field has been set. + +### GetOnDemandLink + +`func (o *InvoiceCallback) GetOnDemandLink() string` + +GetOnDemandLink returns the OnDemandLink field if non-nil, zero value otherwise. + +### GetOnDemandLinkOk + +`func (o *InvoiceCallback) GetOnDemandLinkOk() (*string, bool)` + +GetOnDemandLinkOk returns a tuple with the OnDemandLink field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOnDemandLink + +`func (o *InvoiceCallback) SetOnDemandLink(v string)` + +SetOnDemandLink sets OnDemandLink field to given value. + +### HasOnDemandLink + +`func (o *InvoiceCallback) HasOnDemandLink() bool` + +HasOnDemandLink returns a boolean if a field has been set. + +### GetRecurringPaymentId + +`func (o *InvoiceCallback) GetRecurringPaymentId() string` + +GetRecurringPaymentId returns the RecurringPaymentId field if non-nil, zero value otherwise. + +### GetRecurringPaymentIdOk + +`func (o *InvoiceCallback) GetRecurringPaymentIdOk() (*string, bool)` + +GetRecurringPaymentIdOk returns a tuple with the RecurringPaymentId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRecurringPaymentId + +`func (o *InvoiceCallback) SetRecurringPaymentId(v string)` + +SetRecurringPaymentId sets RecurringPaymentId field to given value. + +### HasRecurringPaymentId + +`func (o *InvoiceCallback) HasRecurringPaymentId() bool` + +HasRecurringPaymentId returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/InvoiceCallbackItem.md b/docs/invoice/InvoiceCallbackItem.md new file mode 100644 index 00000000..4d445261 --- /dev/null +++ b/docs/invoice/InvoiceCallbackItem.md @@ -0,0 +1,145 @@ +# InvoiceCallbackItem +An object representing an item within an invoice. + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **Name** | **string** | ☑️ | The name of the item. | | +| **Price** | **float32** | ☑️ | The price of the item. | | +| **Quantity** | **float32** | ☑️ | The quantity of the item. Must be greater than or equal to 0. | | +| **Url** | Pointer to **string** | | The URL associated with the item. | | +| **Category** | Pointer to **string** | | The category of the item. | | + +## Methods + +### NewInvoiceCallbackItem + +`func NewInvoiceCallbackItem(name string, price float32, quantity float32, ) *InvoiceCallbackItem` + +NewInvoiceCallbackItem instantiates a new InvoiceCallbackItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInvoiceCallbackItemWithDefaults + +`func NewInvoiceCallbackItemWithDefaults() *InvoiceCallbackItem` + +NewInvoiceCallbackItemWithDefaults instantiates a new InvoiceCallbackItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *InvoiceCallbackItem) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *InvoiceCallbackItem) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *InvoiceCallbackItem) SetName(v string)` + +SetName sets Name field to given value. + + +### GetPrice + +`func (o *InvoiceCallbackItem) GetPrice() float32` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *InvoiceCallbackItem) GetPriceOk() (*float32, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *InvoiceCallbackItem) SetPrice(v float32)` + +SetPrice sets Price field to given value. + + +### GetQuantity + +`func (o *InvoiceCallbackItem) GetQuantity() float32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *InvoiceCallbackItem) GetQuantityOk() (*float32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *InvoiceCallbackItem) SetQuantity(v float32)` + +SetQuantity sets Quantity field to given value. + + +### GetUrl + +`func (o *InvoiceCallbackItem) GetUrl() string` + +GetUrl returns the Url field if non-nil, zero value otherwise. + +### GetUrlOk + +`func (o *InvoiceCallbackItem) GetUrlOk() (*string, bool)` + +GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUrl + +`func (o *InvoiceCallbackItem) SetUrl(v string)` + +SetUrl sets Url field to given value. + +### HasUrl + +`func (o *InvoiceCallbackItem) HasUrl() bool` + +HasUrl returns a boolean if a field has been set. + +### GetCategory + +`func (o *InvoiceCallbackItem) GetCategory() string` + +GetCategory returns the Category field if non-nil, zero value otherwise. + +### GetCategoryOk + +`func (o *InvoiceCallbackItem) GetCategoryOk() (*string, bool)` + +GetCategoryOk returns a tuple with the Category field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategory + +`func (o *InvoiceCallbackItem) SetCategory(v string)` + +SetCategory sets Category field to given value. + +### HasCategory + +`func (o *InvoiceCallbackItem) HasCategory() bool` + +HasCategory returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/invoice/PaymentDetails.md b/docs/invoice/PaymentDetails.md new file mode 100644 index 00000000..16b85eae --- /dev/null +++ b/docs/invoice/PaymentDetails.md @@ -0,0 +1,82 @@ +# PaymentDetails +An object representing payment details. + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **ReceiptId** | Pointer to **string** | | The unique identifier or reference ID associated with the payment receipt. | | +| **Source** | Pointer to **string** | | The source or method of payment. | | + +## Methods + +### NewPaymentDetails + +`func NewPaymentDetails() *PaymentDetails` + +NewPaymentDetails instantiates a new PaymentDetails object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentDetailsWithDefaults + +`func NewPaymentDetailsWithDefaults() *PaymentDetails` + +NewPaymentDetailsWithDefaults instantiates a new PaymentDetails object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetReceiptId + +`func (o *PaymentDetails) GetReceiptId() string` + +GetReceiptId returns the ReceiptId field if non-nil, zero value otherwise. + +### GetReceiptIdOk + +`func (o *PaymentDetails) GetReceiptIdOk() (*string, bool)` + +GetReceiptIdOk returns a tuple with the ReceiptId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReceiptId + +`func (o *PaymentDetails) SetReceiptId(v string)` + +SetReceiptId sets ReceiptId field to given value. + +### HasReceiptId + +`func (o *PaymentDetails) HasReceiptId() bool` + +HasReceiptId returns a boolean if a field has been set. + +### GetSource + +`func (o *PaymentDetails) GetSource() string` + +GetSource returns the Source field if non-nil, zero value otherwise. + +### GetSourceOk + +`func (o *PaymentDetails) GetSourceOk() (*string, bool)` + +GetSourceOk returns a tuple with the Source field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSource + +`func (o *PaymentDetails) SetSource(v string)` + +SetSource sets Source field to given value. + +### HasSource + +`func (o *PaymentDetails) HasSource() bool` + +HasSource returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_method/PaymentMethodCallback.md b/docs/payment_method/PaymentMethodCallback.md new file mode 100644 index 00000000..73985d8d --- /dev/null +++ b/docs/payment_method/PaymentMethodCallback.md @@ -0,0 +1,119 @@ +# PaymentMethodCallback +Callback for active or expired E-Wallet or Direct Debit account linking, Virtual Accounts or QR strings + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **Event** | **string** | ☑️ | Identifies the event that triggered a notification to the merchant | | +| **BusinessId** | **string** | ☑️ | business_id | | +| **Created** | **string** | ☑️ | | | +| **Data** | Pointer to [**PaymentMethod**](PaymentMethod.md) | | | | + +## Methods + +### NewPaymentMethodCallback + +`func NewPaymentMethodCallback(event string, businessId string, created string, ) *PaymentMethodCallback` + +NewPaymentMethodCallback instantiates a new PaymentMethodCallback object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentMethodCallbackWithDefaults + +`func NewPaymentMethodCallbackWithDefaults() *PaymentMethodCallback` + +NewPaymentMethodCallbackWithDefaults instantiates a new PaymentMethodCallback object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEvent + +`func (o *PaymentMethodCallback) GetEvent() string` + +GetEvent returns the Event field if non-nil, zero value otherwise. + +### GetEventOk + +`func (o *PaymentMethodCallback) GetEventOk() (*string, bool)` + +GetEventOk returns a tuple with the Event field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEvent + +`func (o *PaymentMethodCallback) SetEvent(v string)` + +SetEvent sets Event field to given value. + + +### GetBusinessId + +`func (o *PaymentMethodCallback) GetBusinessId() string` + +GetBusinessId returns the BusinessId field if non-nil, zero value otherwise. + +### GetBusinessIdOk + +`func (o *PaymentMethodCallback) GetBusinessIdOk() (*string, bool)` + +GetBusinessIdOk returns a tuple with the BusinessId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBusinessId + +`func (o *PaymentMethodCallback) SetBusinessId(v string)` + +SetBusinessId sets BusinessId field to given value. + + +### GetCreated + +`func (o *PaymentMethodCallback) GetCreated() string` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *PaymentMethodCallback) GetCreatedOk() (*string, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *PaymentMethodCallback) SetCreated(v string)` + +SetCreated sets Created field to given value. + + +### GetData + +`func (o *PaymentMethodCallback) GetData() PaymentMethod` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *PaymentMethodCallback) GetDataOk() (*PaymentMethod, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *PaymentMethodCallback) SetData(v PaymentMethod)` + +SetData sets Data field to given value. + +### HasData + +`func (o *PaymentMethodCallback) HasData() bool` + +HasData returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/InvoicePartnerMetadata.md b/docs/payment_request/InvoicePartnerMetadata.md new file mode 100644 index 00000000..6a2f20b3 --- /dev/null +++ b/docs/payment_request/InvoicePartnerMetadata.md @@ -0,0 +1,56 @@ +# InvoicePartnerMetadata + + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **Notes** | Pointer to **string** | | | | + +## Methods + +### NewInvoicePartnerMetadata + +`func NewInvoicePartnerMetadata() *InvoicePartnerMetadata` + +NewInvoicePartnerMetadata instantiates a new InvoicePartnerMetadata object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInvoicePartnerMetadataWithDefaults + +`func NewInvoicePartnerMetadataWithDefaults() *InvoicePartnerMetadata` + +NewInvoicePartnerMetadataWithDefaults instantiates a new InvoicePartnerMetadata object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNotes + +`func (o *InvoicePartnerMetadata) GetNotes() string` + +GetNotes returns the Notes field if non-nil, zero value otherwise. + +### GetNotesOk + +`func (o *InvoicePartnerMetadata) GetNotesOk() (*string, bool)` + +GetNotesOk returns a tuple with the Notes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNotes + +`func (o *InvoicePartnerMetadata) SetNotes(v string)` + +SetNotes sets Notes field to given value. + +### HasNotes + +`func (o *InvoicePartnerMetadata) HasNotes() bool` + +HasNotes returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentCallback.md b/docs/payment_request/PaymentCallback.md new file mode 100644 index 00000000..f62f9aac --- /dev/null +++ b/docs/payment_request/PaymentCallback.md @@ -0,0 +1,119 @@ +# PaymentCallback +Callback for successful or failed payments made via the Payments API + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **Event** | **string** | ☑️ | Identifies the event that triggered a notification to the merchant | | +| **BusinessId** | **string** | ☑️ | business_id | | +| **Created** | **string** | ☑️ | | | +| **Data** | Pointer to [**PaymentCallbackData**](PaymentCallbackData.md) | | | | + +## Methods + +### NewPaymentCallback + +`func NewPaymentCallback(event string, businessId string, created string, ) *PaymentCallback` + +NewPaymentCallback instantiates a new PaymentCallback object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentCallbackWithDefaults + +`func NewPaymentCallbackWithDefaults() *PaymentCallback` + +NewPaymentCallbackWithDefaults instantiates a new PaymentCallback object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEvent + +`func (o *PaymentCallback) GetEvent() string` + +GetEvent returns the Event field if non-nil, zero value otherwise. + +### GetEventOk + +`func (o *PaymentCallback) GetEventOk() (*string, bool)` + +GetEventOk returns a tuple with the Event field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEvent + +`func (o *PaymentCallback) SetEvent(v string)` + +SetEvent sets Event field to given value. + + +### GetBusinessId + +`func (o *PaymentCallback) GetBusinessId() string` + +GetBusinessId returns the BusinessId field if non-nil, zero value otherwise. + +### GetBusinessIdOk + +`func (o *PaymentCallback) GetBusinessIdOk() (*string, bool)` + +GetBusinessIdOk returns a tuple with the BusinessId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBusinessId + +`func (o *PaymentCallback) SetBusinessId(v string)` + +SetBusinessId sets BusinessId field to given value. + + +### GetCreated + +`func (o *PaymentCallback) GetCreated() string` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *PaymentCallback) GetCreatedOk() (*string, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *PaymentCallback) SetCreated(v string)` + +SetCreated sets Created field to given value. + + +### GetData + +`func (o *PaymentCallback) GetData() PaymentCallbackData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *PaymentCallback) GetDataOk() (*PaymentCallbackData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *PaymentCallback) SetData(v PaymentCallbackData)` + +SetData sets Data field to given value. + +### HasData + +`func (o *PaymentCallback) HasData() bool` + +HasData returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/payment_request/PaymentCallbackData.md b/docs/payment_request/PaymentCallbackData.md new file mode 100644 index 00000000..3527ecdf --- /dev/null +++ b/docs/payment_request/PaymentCallbackData.md @@ -0,0 +1,435 @@ +# PaymentCallbackData +Represents the actual funds transaction/attempt made to a payment method + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **Id** | **string** | ☑️ | | | +| **PaymentRequestId** | Pointer to **NullableString** | | | | +| **ReferenceId** | **string** | ☑️ | | | +| **CustomerId** | Pointer to **NullableString** | | | | +| **Currency** | **string** | ☑️ | | | +| **Amount** | **float64** | ☑️ | | | +| **Country** | **string** | ☑️ | | | +| **Status** | **string** | ☑️ | | | +| **PaymentMethod** | [**PaymentMethod**](PaymentMethod.md) | ☑️ | | | +| **ChannelProperties** | Pointer to [**NullablePaymentRequestChannelProperties**](PaymentRequestChannelProperties.md) | | | | +| **PaymentDetail** | Pointer to **map[string]interface{}** | | | | +| **FailureCode** | Pointer to **map[string]interface{}** | | | | +| **Created** | **string** | ☑️ | | | +| **Updated** | **string** | ☑️ | | | +| **Metadata** | Pointer to **map[string]interface{}** | | | | + +## Methods + +### NewPaymentCallbackData + +`func NewPaymentCallbackData(id string, referenceId string, currency string, amount float64, country string, status string, paymentMethod PaymentMethod, created string, updated string, ) *PaymentCallbackData` + +NewPaymentCallbackData instantiates a new PaymentCallbackData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPaymentCallbackDataWithDefaults + +`func NewPaymentCallbackDataWithDefaults() *PaymentCallbackData` + +NewPaymentCallbackDataWithDefaults instantiates a new PaymentCallbackData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *PaymentCallbackData) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *PaymentCallbackData) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *PaymentCallbackData) SetId(v string)` + +SetId sets Id field to given value. + + +### GetPaymentRequestId + +`func (o *PaymentCallbackData) GetPaymentRequestId() string` + +GetPaymentRequestId returns the PaymentRequestId field if non-nil, zero value otherwise. + +### GetPaymentRequestIdOk + +`func (o *PaymentCallbackData) GetPaymentRequestIdOk() (*string, bool)` + +GetPaymentRequestIdOk returns a tuple with the PaymentRequestId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentRequestId + +`func (o *PaymentCallbackData) SetPaymentRequestId(v string)` + +SetPaymentRequestId sets PaymentRequestId field to given value. + +### HasPaymentRequestId + +`func (o *PaymentCallbackData) HasPaymentRequestId() bool` + +HasPaymentRequestId returns a boolean if a field has been set. + +### SetPaymentRequestIdNil + +`func (o *PaymentCallbackData) SetPaymentRequestIdNil(b bool)` + + SetPaymentRequestIdNil sets the value for PaymentRequestId to be an explicit nil + +### UnsetPaymentRequestId +`func (o *PaymentCallbackData) UnsetPaymentRequestId()` + +UnsetPaymentRequestId ensures that no value is present for PaymentRequestId, not even an explicit nil +### GetReferenceId + +`func (o *PaymentCallbackData) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *PaymentCallbackData) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *PaymentCallbackData) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + + +### GetCustomerId + +`func (o *PaymentCallbackData) GetCustomerId() string` + +GetCustomerId returns the CustomerId field if non-nil, zero value otherwise. + +### GetCustomerIdOk + +`func (o *PaymentCallbackData) GetCustomerIdOk() (*string, bool)` + +GetCustomerIdOk returns a tuple with the CustomerId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomerId + +`func (o *PaymentCallbackData) SetCustomerId(v string)` + +SetCustomerId sets CustomerId field to given value. + +### HasCustomerId + +`func (o *PaymentCallbackData) HasCustomerId() bool` + +HasCustomerId returns a boolean if a field has been set. + +### SetCustomerIdNil + +`func (o *PaymentCallbackData) SetCustomerIdNil(b bool)` + + SetCustomerIdNil sets the value for CustomerId to be an explicit nil + +### UnsetCustomerId +`func (o *PaymentCallbackData) UnsetCustomerId()` + +UnsetCustomerId ensures that no value is present for CustomerId, not even an explicit nil +### GetCurrency + +`func (o *PaymentCallbackData) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *PaymentCallbackData) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *PaymentCallbackData) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + + +### GetAmount + +`func (o *PaymentCallbackData) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *PaymentCallbackData) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *PaymentCallbackData) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + + +### GetCountry + +`func (o *PaymentCallbackData) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *PaymentCallbackData) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *PaymentCallbackData) SetCountry(v string)` + +SetCountry sets Country field to given value. + + +### GetStatus + +`func (o *PaymentCallbackData) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *PaymentCallbackData) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *PaymentCallbackData) SetStatus(v string)` + +SetStatus sets Status field to given value. + + +### GetPaymentMethod + +`func (o *PaymentCallbackData) GetPaymentMethod() PaymentMethod` + +GetPaymentMethod returns the PaymentMethod field if non-nil, zero value otherwise. + +### GetPaymentMethodOk + +`func (o *PaymentCallbackData) GetPaymentMethodOk() (*PaymentMethod, bool)` + +GetPaymentMethodOk returns a tuple with the PaymentMethod field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethod + +`func (o *PaymentCallbackData) SetPaymentMethod(v PaymentMethod)` + +SetPaymentMethod sets PaymentMethod field to given value. + + +### GetChannelProperties + +`func (o *PaymentCallbackData) GetChannelProperties() PaymentRequestChannelProperties` + +GetChannelProperties returns the ChannelProperties field if non-nil, zero value otherwise. + +### GetChannelPropertiesOk + +`func (o *PaymentCallbackData) GetChannelPropertiesOk() (*PaymentRequestChannelProperties, bool)` + +GetChannelPropertiesOk returns a tuple with the ChannelProperties field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelProperties + +`func (o *PaymentCallbackData) SetChannelProperties(v PaymentRequestChannelProperties)` + +SetChannelProperties sets ChannelProperties field to given value. + +### HasChannelProperties + +`func (o *PaymentCallbackData) HasChannelProperties() bool` + +HasChannelProperties returns a boolean if a field has been set. + +### SetChannelPropertiesNil + +`func (o *PaymentCallbackData) SetChannelPropertiesNil(b bool)` + + SetChannelPropertiesNil sets the value for ChannelProperties to be an explicit nil + +### UnsetChannelProperties +`func (o *PaymentCallbackData) UnsetChannelProperties()` + +UnsetChannelProperties ensures that no value is present for ChannelProperties, not even an explicit nil +### GetPaymentDetail + +`func (o *PaymentCallbackData) GetPaymentDetail() map[string]interface{}` + +GetPaymentDetail returns the PaymentDetail field if non-nil, zero value otherwise. + +### GetPaymentDetailOk + +`func (o *PaymentCallbackData) GetPaymentDetailOk() (*map[string]interface{}, bool)` + +GetPaymentDetailOk returns a tuple with the PaymentDetail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentDetail + +`func (o *PaymentCallbackData) SetPaymentDetail(v map[string]interface{})` + +SetPaymentDetail sets PaymentDetail field to given value. + +### HasPaymentDetail + +`func (o *PaymentCallbackData) HasPaymentDetail() bool` + +HasPaymentDetail returns a boolean if a field has been set. + +### SetPaymentDetailNil + +`func (o *PaymentCallbackData) SetPaymentDetailNil(b bool)` + + SetPaymentDetailNil sets the value for PaymentDetail to be an explicit nil + +### UnsetPaymentDetail +`func (o *PaymentCallbackData) UnsetPaymentDetail()` + +UnsetPaymentDetail ensures that no value is present for PaymentDetail, not even an explicit nil +### GetFailureCode + +`func (o *PaymentCallbackData) GetFailureCode() map[string]interface{}` + +GetFailureCode returns the FailureCode field if non-nil, zero value otherwise. + +### GetFailureCodeOk + +`func (o *PaymentCallbackData) GetFailureCodeOk() (*map[string]interface{}, bool)` + +GetFailureCodeOk returns a tuple with the FailureCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureCode + +`func (o *PaymentCallbackData) SetFailureCode(v map[string]interface{})` + +SetFailureCode sets FailureCode field to given value. + +### HasFailureCode + +`func (o *PaymentCallbackData) HasFailureCode() bool` + +HasFailureCode returns a boolean if a field has been set. + +### SetFailureCodeNil + +`func (o *PaymentCallbackData) SetFailureCodeNil(b bool)` + + SetFailureCodeNil sets the value for FailureCode to be an explicit nil + +### UnsetFailureCode +`func (o *PaymentCallbackData) UnsetFailureCode()` + +UnsetFailureCode ensures that no value is present for FailureCode, not even an explicit nil +### GetCreated + +`func (o *PaymentCallbackData) GetCreated() string` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *PaymentCallbackData) GetCreatedOk() (*string, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *PaymentCallbackData) SetCreated(v string)` + +SetCreated sets Created field to given value. + + +### GetUpdated + +`func (o *PaymentCallbackData) GetUpdated() string` + +GetUpdated returns the Updated field if non-nil, zero value otherwise. + +### GetUpdatedOk + +`func (o *PaymentCallbackData) GetUpdatedOk() (*string, bool)` + +GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdated + +`func (o *PaymentCallbackData) SetUpdated(v string)` + +SetUpdated sets Updated field to given value. + + +### GetMetadata + +`func (o *PaymentCallbackData) GetMetadata() map[string]interface{}` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *PaymentCallbackData) GetMetadataOk() (*map[string]interface{}, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *PaymentCallbackData) SetMetadata(v map[string]interface{})` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *PaymentCallbackData) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### SetMetadataNil + +`func (o *PaymentCallbackData) SetMetadataNil(b bool)` + + SetMetadataNil sets the value for Metadata to be an explicit nil + +### UnsetMetadata +`func (o *PaymentCallbackData) UnsetMetadata()` + +UnsetMetadata ensures that no value is present for Metadata, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/docs/refund/RefundCallback.md b/docs/refund/RefundCallback.md new file mode 100644 index 00000000..265ab2f3 --- /dev/null +++ b/docs/refund/RefundCallback.md @@ -0,0 +1,119 @@ +# RefundCallback +Callback for successful or failed Refunds made via the Payments API + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **Event** | **string** | ☑️ | Identifies the event that triggered a notification to the merchant | | +| **BusinessId** | **string** | ☑️ | business_id | | +| **Created** | **string** | ☑️ | | | +| **Data** | Pointer to [**RefundCallbackData**](RefundCallbackData.md) | | | | + +## Methods + +### NewRefundCallback + +`func NewRefundCallback(event string, businessId string, created string, ) *RefundCallback` + +NewRefundCallback instantiates a new RefundCallback object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRefundCallbackWithDefaults + +`func NewRefundCallbackWithDefaults() *RefundCallback` + +NewRefundCallbackWithDefaults instantiates a new RefundCallback object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEvent + +`func (o *RefundCallback) GetEvent() string` + +GetEvent returns the Event field if non-nil, zero value otherwise. + +### GetEventOk + +`func (o *RefundCallback) GetEventOk() (*string, bool)` + +GetEventOk returns a tuple with the Event field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEvent + +`func (o *RefundCallback) SetEvent(v string)` + +SetEvent sets Event field to given value. + + +### GetBusinessId + +`func (o *RefundCallback) GetBusinessId() string` + +GetBusinessId returns the BusinessId field if non-nil, zero value otherwise. + +### GetBusinessIdOk + +`func (o *RefundCallback) GetBusinessIdOk() (*string, bool)` + +GetBusinessIdOk returns a tuple with the BusinessId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBusinessId + +`func (o *RefundCallback) SetBusinessId(v string)` + +SetBusinessId sets BusinessId field to given value. + + +### GetCreated + +`func (o *RefundCallback) GetCreated() string` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *RefundCallback) GetCreatedOk() (*string, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *RefundCallback) SetCreated(v string)` + +SetCreated sets Created field to given value. + + +### GetData + +`func (o *RefundCallback) GetData() RefundCallbackData` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *RefundCallback) GetDataOk() (*RefundCallbackData, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *RefundCallback) SetData(v RefundCallbackData)` + +SetData sets Data field to given value. + +### HasData + +`func (o *RefundCallback) HasData() bool` + +HasData returns a boolean if a field has been set. + + +[[Back to README]](../../README.md) + + diff --git a/docs/refund/RefundCallbackData.md b/docs/refund/RefundCallbackData.md new file mode 100644 index 00000000..63a805f4 --- /dev/null +++ b/docs/refund/RefundCallbackData.md @@ -0,0 +1,441 @@ +# RefundCallbackData + + +## Properties +| Name | Type | Required | Description | Examples | +|------------|:-------------:|:-------------:|-------------|:-------------:| +| **Id** | **string** | ☑️ | | | +| **PaymentRequestId** | **string** | ☑️ | | | +| **InvoiceId** | Pointer to **NullableString** | | | | +| **PaymentMethodType** | **string** | ☑️ | | | +| **Amount** | **float64** | ☑️ | | | +| **ChannelCode** | **string** | ☑️ | | | +| **Status** | **string** | ☑️ | | | +| **Reason** | **string** | ☑️ | | | +| **Country** | **string** | ☑️ | | | +| **Currency** | **string** | ☑️ | | | +| **ReferenceId** | Pointer to **NullableString** | | | | +| **FailureCode** | Pointer to **NullableString** | | | | +| **RefundFeeAmount** | Pointer to **NullableFloat64** | | | | +| **Created** | **string** | ☑️ | | | +| **Updated** | **string** | ☑️ | | | +| **Metadata** | Pointer to **map[string]interface{}** | | | | + +## Methods + +### NewRefundCallbackData + +`func NewRefundCallbackData(id string, paymentRequestId string, paymentMethodType string, amount float64, channelCode string, status string, reason string, country string, currency string, created string, updated string, ) *RefundCallbackData` + +NewRefundCallbackData instantiates a new RefundCallbackData object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRefundCallbackDataWithDefaults + +`func NewRefundCallbackDataWithDefaults() *RefundCallbackData` + +NewRefundCallbackDataWithDefaults instantiates a new RefundCallbackData object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *RefundCallbackData) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *RefundCallbackData) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *RefundCallbackData) SetId(v string)` + +SetId sets Id field to given value. + + +### GetPaymentRequestId + +`func (o *RefundCallbackData) GetPaymentRequestId() string` + +GetPaymentRequestId returns the PaymentRequestId field if non-nil, zero value otherwise. + +### GetPaymentRequestIdOk + +`func (o *RefundCallbackData) GetPaymentRequestIdOk() (*string, bool)` + +GetPaymentRequestIdOk returns a tuple with the PaymentRequestId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentRequestId + +`func (o *RefundCallbackData) SetPaymentRequestId(v string)` + +SetPaymentRequestId sets PaymentRequestId field to given value. + + +### GetInvoiceId + +`func (o *RefundCallbackData) GetInvoiceId() string` + +GetInvoiceId returns the InvoiceId field if non-nil, zero value otherwise. + +### GetInvoiceIdOk + +`func (o *RefundCallbackData) GetInvoiceIdOk() (*string, bool)` + +GetInvoiceIdOk returns a tuple with the InvoiceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInvoiceId + +`func (o *RefundCallbackData) SetInvoiceId(v string)` + +SetInvoiceId sets InvoiceId field to given value. + +### HasInvoiceId + +`func (o *RefundCallbackData) HasInvoiceId() bool` + +HasInvoiceId returns a boolean if a field has been set. + +### SetInvoiceIdNil + +`func (o *RefundCallbackData) SetInvoiceIdNil(b bool)` + + SetInvoiceIdNil sets the value for InvoiceId to be an explicit nil + +### UnsetInvoiceId +`func (o *RefundCallbackData) UnsetInvoiceId()` + +UnsetInvoiceId ensures that no value is present for InvoiceId, not even an explicit nil +### GetPaymentMethodType + +`func (o *RefundCallbackData) GetPaymentMethodType() string` + +GetPaymentMethodType returns the PaymentMethodType field if non-nil, zero value otherwise. + +### GetPaymentMethodTypeOk + +`func (o *RefundCallbackData) GetPaymentMethodTypeOk() (*string, bool)` + +GetPaymentMethodTypeOk returns a tuple with the PaymentMethodType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentMethodType + +`func (o *RefundCallbackData) SetPaymentMethodType(v string)` + +SetPaymentMethodType sets PaymentMethodType field to given value. + + +### GetAmount + +`func (o *RefundCallbackData) GetAmount() float64` + +GetAmount returns the Amount field if non-nil, zero value otherwise. + +### GetAmountOk + +`func (o *RefundCallbackData) GetAmountOk() (*float64, bool)` + +GetAmountOk returns a tuple with the Amount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAmount + +`func (o *RefundCallbackData) SetAmount(v float64)` + +SetAmount sets Amount field to given value. + + +### GetChannelCode + +`func (o *RefundCallbackData) GetChannelCode() string` + +GetChannelCode returns the ChannelCode field if non-nil, zero value otherwise. + +### GetChannelCodeOk + +`func (o *RefundCallbackData) GetChannelCodeOk() (*string, bool)` + +GetChannelCodeOk returns a tuple with the ChannelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChannelCode + +`func (o *RefundCallbackData) SetChannelCode(v string)` + +SetChannelCode sets ChannelCode field to given value. + + +### GetStatus + +`func (o *RefundCallbackData) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *RefundCallbackData) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *RefundCallbackData) SetStatus(v string)` + +SetStatus sets Status field to given value. + + +### GetReason + +`func (o *RefundCallbackData) GetReason() string` + +GetReason returns the Reason field if non-nil, zero value otherwise. + +### GetReasonOk + +`func (o *RefundCallbackData) GetReasonOk() (*string, bool)` + +GetReasonOk returns a tuple with the Reason field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReason + +`func (o *RefundCallbackData) SetReason(v string)` + +SetReason sets Reason field to given value. + + +### GetCountry + +`func (o *RefundCallbackData) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *RefundCallbackData) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *RefundCallbackData) SetCountry(v string)` + +SetCountry sets Country field to given value. + + +### GetCurrency + +`func (o *RefundCallbackData) GetCurrency() string` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *RefundCallbackData) GetCurrencyOk() (*string, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *RefundCallbackData) SetCurrency(v string)` + +SetCurrency sets Currency field to given value. + + +### GetReferenceId + +`func (o *RefundCallbackData) GetReferenceId() string` + +GetReferenceId returns the ReferenceId field if non-nil, zero value otherwise. + +### GetReferenceIdOk + +`func (o *RefundCallbackData) GetReferenceIdOk() (*string, bool)` + +GetReferenceIdOk returns a tuple with the ReferenceId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReferenceId + +`func (o *RefundCallbackData) SetReferenceId(v string)` + +SetReferenceId sets ReferenceId field to given value. + +### HasReferenceId + +`func (o *RefundCallbackData) HasReferenceId() bool` + +HasReferenceId returns a boolean if a field has been set. + +### SetReferenceIdNil + +`func (o *RefundCallbackData) SetReferenceIdNil(b bool)` + + SetReferenceIdNil sets the value for ReferenceId to be an explicit nil + +### UnsetReferenceId +`func (o *RefundCallbackData) UnsetReferenceId()` + +UnsetReferenceId ensures that no value is present for ReferenceId, not even an explicit nil +### GetFailureCode + +`func (o *RefundCallbackData) GetFailureCode() string` + +GetFailureCode returns the FailureCode field if non-nil, zero value otherwise. + +### GetFailureCodeOk + +`func (o *RefundCallbackData) GetFailureCodeOk() (*string, bool)` + +GetFailureCodeOk returns a tuple with the FailureCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailureCode + +`func (o *RefundCallbackData) SetFailureCode(v string)` + +SetFailureCode sets FailureCode field to given value. + +### HasFailureCode + +`func (o *RefundCallbackData) HasFailureCode() bool` + +HasFailureCode returns a boolean if a field has been set. + +### SetFailureCodeNil + +`func (o *RefundCallbackData) SetFailureCodeNil(b bool)` + + SetFailureCodeNil sets the value for FailureCode to be an explicit nil + +### UnsetFailureCode +`func (o *RefundCallbackData) UnsetFailureCode()` + +UnsetFailureCode ensures that no value is present for FailureCode, not even an explicit nil +### GetRefundFeeAmount + +`func (o *RefundCallbackData) GetRefundFeeAmount() float64` + +GetRefundFeeAmount returns the RefundFeeAmount field if non-nil, zero value otherwise. + +### GetRefundFeeAmountOk + +`func (o *RefundCallbackData) GetRefundFeeAmountOk() (*float64, bool)` + +GetRefundFeeAmountOk returns a tuple with the RefundFeeAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRefundFeeAmount + +`func (o *RefundCallbackData) SetRefundFeeAmount(v float64)` + +SetRefundFeeAmount sets RefundFeeAmount field to given value. + +### HasRefundFeeAmount + +`func (o *RefundCallbackData) HasRefundFeeAmount() bool` + +HasRefundFeeAmount returns a boolean if a field has been set. + +### SetRefundFeeAmountNil + +`func (o *RefundCallbackData) SetRefundFeeAmountNil(b bool)` + + SetRefundFeeAmountNil sets the value for RefundFeeAmount to be an explicit nil + +### UnsetRefundFeeAmount +`func (o *RefundCallbackData) UnsetRefundFeeAmount()` + +UnsetRefundFeeAmount ensures that no value is present for RefundFeeAmount, not even an explicit nil +### GetCreated + +`func (o *RefundCallbackData) GetCreated() string` + +GetCreated returns the Created field if non-nil, zero value otherwise. + +### GetCreatedOk + +`func (o *RefundCallbackData) GetCreatedOk() (*string, bool)` + +GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreated + +`func (o *RefundCallbackData) SetCreated(v string)` + +SetCreated sets Created field to given value. + + +### GetUpdated + +`func (o *RefundCallbackData) GetUpdated() string` + +GetUpdated returns the Updated field if non-nil, zero value otherwise. + +### GetUpdatedOk + +`func (o *RefundCallbackData) GetUpdatedOk() (*string, bool)` + +GetUpdatedOk returns a tuple with the Updated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdated + +`func (o *RefundCallbackData) SetUpdated(v string)` + +SetUpdated sets Updated field to given value. + + +### GetMetadata + +`func (o *RefundCallbackData) GetMetadata() map[string]interface{}` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *RefundCallbackData) GetMetadataOk() (*map[string]interface{}, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *RefundCallbackData) SetMetadata(v map[string]interface{})` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *RefundCallbackData) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### SetMetadataNil + +`func (o *RefundCallbackData) SetMetadataNil(b bool)` + + SetMetadataNil sets the value for Metadata to be an explicit nil + +### UnsetMetadata +`func (o *RefundCallbackData) UnsetMetadata()` + +UnsetMetadata ensures that no value is present for Metadata, not even an explicit nil + +[[Back to README]](../../README.md) + + diff --git a/go.mod b/go.mod index 58cbc9bf..a97e67c4 100644 --- a/go.mod +++ b/go.mod @@ -2,10 +2,7 @@ module github.com/xendit/xendit-go/v3 go 1.18 -require ( - github.com/joho/godotenv v1.5.1 - github.com/stretchr/testify v1.8.4 -) +require github.com/stretchr/testify v1.8.4 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/go.sum b/go.sum index 26059cd9..fa4b6e68 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= -github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= diff --git a/invoice/model_invoice_callback.go b/invoice/model_invoice_callback.go new file mode 100644 index 00000000..3a833b67 --- /dev/null +++ b/invoice/model_invoice_callback.go @@ -0,0 +1,1044 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + + +package invoice + +import ( + "encoding/json" + + utils "github.com/xendit/xendit-go/v3/utils" +) + +// checks if the InvoiceCallback type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &InvoiceCallback{} + +// InvoiceCallback Invoice Callback Object +type InvoiceCallback struct { + // An invoice ID generated by Xendit + Id string `json:"id"` + // ID of your choice (typically the unique identifier of an invoice in your system) + ExternalId string `json:"external_id"` + // Xendit Business ID + UserId string `json:"user_id"` + // The status of the invoice. + Status string `json:"status"` + // The name of company or website + MerchantName string `json:"merchant_name"` + // Nominal amount for the invoice + Amount float32 `json:"amount"` + // Email of the payer + PayerEmail *string `json:"payer_email,omitempty"` + // Description for the invoice + Description *string `json:"description,omitempty"` + // Total amount paid for the invoice + PaidAmount *float32 `json:"paid_amount,omitempty"` + // The date and time when the invoice was created. + Created string `json:"created"` + // The date and time when the invoice was last updated. + Updated string `json:"updated"` + // The currency of the invoice. + Currency string `json:"currency"` + // The date and time when the invoice was paid. + PaidAt *string `json:"paid_at,omitempty"` + // The payment method used for the invoice. + PaymentMethod *string `json:"payment_method,omitempty"` + // The payment channel. + PaymentChannel *string `json:"payment_channel,omitempty"` + // The payment destination. + PaymentDestination *string `json:"payment_destination,omitempty"` + PaymentDetails *PaymentDetails `json:"payment_details,omitempty"` + // The ID of the payment. + PaymentId *string `json:"payment_id,omitempty"` + // The URL to redirect to on successful payment. + SuccessRedirectUrl *string `json:"success_redirect_url,omitempty"` + // The URL to redirect to on payment failure. + FailureRedirectUrl *string `json:"failure_redirect_url,omitempty"` + // The ID associated with a credit card charge (if applicable). + CreditCardChargeId *string `json:"credit_card_charge_id,omitempty"` + Items []InvoiceCallbackItem `json:"items,omitempty"` + // An array of fees associated with the invoice. + Fees []InvoiceFee `json:"fees,omitempty"` + // Indicates whether credit card authentication is required. + ShouldAuthenticateCreditCard *bool `json:"should_authenticate_credit_card,omitempty"` + // The bank code for the bank details. + BankCode *string `json:"bank_code,omitempty"` + // The type of eWallet. + EwalletType *string `json:"ewallet_type,omitempty"` + // The on-demand link. + OnDemandLink *string `json:"on_demand_link,omitempty"` + // The ID of the recurring payment. + RecurringPaymentId *string `json:"recurring_payment_id,omitempty"` +} + +// NewInvoiceCallback instantiates a new InvoiceCallback object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvoiceCallback(id string, externalId string, userId string, status string, merchantName string, amount float32, created string, updated string, currency string) *InvoiceCallback { + this := InvoiceCallback{} + this.Id = id + this.ExternalId = externalId + this.UserId = userId + this.Status = status + this.MerchantName = merchantName + this.Amount = amount + this.Created = created + this.Updated = updated + this.Currency = currency + return &this +} + +// NewInvoiceCallbackWithDefaults instantiates a new InvoiceCallback object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvoiceCallbackWithDefaults() *InvoiceCallback { + this := InvoiceCallback{} + return &this +} + +// GetId returns the Id field value +func (o *InvoiceCallback) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *InvoiceCallback) SetId(v string) { + o.Id = v +} + +// GetExternalId returns the ExternalId field value +func (o *InvoiceCallback) GetExternalId() string { + if o == nil { + var ret string + return ret + } + + return o.ExternalId +} + +// GetExternalIdOk returns a tuple with the ExternalId field value +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetExternalIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExternalId, true +} + +// SetExternalId sets field value +func (o *InvoiceCallback) SetExternalId(v string) { + o.ExternalId = v +} + +// GetUserId returns the UserId field value +func (o *InvoiceCallback) GetUserId() string { + if o == nil { + var ret string + return ret + } + + return o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserId, true +} + +// SetUserId sets field value +func (o *InvoiceCallback) SetUserId(v string) { + o.UserId = v +} + +// GetStatus returns the Status field value +func (o *InvoiceCallback) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *InvoiceCallback) SetStatus(v string) { + o.Status = v +} + +// GetMerchantName returns the MerchantName field value +func (o *InvoiceCallback) GetMerchantName() string { + if o == nil { + var ret string + return ret + } + + return o.MerchantName +} + +// GetMerchantNameOk returns a tuple with the MerchantName field value +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetMerchantNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MerchantName, true +} + +// SetMerchantName sets field value +func (o *InvoiceCallback) SetMerchantName(v string) { + o.MerchantName = v +} + +// GetAmount returns the Amount field value +func (o *InvoiceCallback) GetAmount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetAmountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *InvoiceCallback) SetAmount(v float32) { + o.Amount = v +} + +// GetPayerEmail returns the PayerEmail field value if set, zero value otherwise. +func (o *InvoiceCallback) GetPayerEmail() string { + if o == nil || utils.IsNil(o.PayerEmail) { + var ret string + return ret + } + return *o.PayerEmail +} + +// GetPayerEmailOk returns a tuple with the PayerEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetPayerEmailOk() (*string, bool) { + if o == nil || utils.IsNil(o.PayerEmail) { + return nil, false + } + return o.PayerEmail, true +} + +// HasPayerEmail returns a boolean if a field has been set. +func (o *InvoiceCallback) HasPayerEmail() bool { + if o != nil && !utils.IsNil(o.PayerEmail) { + return true + } + + return false +} + +// SetPayerEmail gets a reference to the given string and assigns it to the PayerEmail field. +func (o *InvoiceCallback) SetPayerEmail(v string) { + o.PayerEmail = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *InvoiceCallback) GetDescription() string { + if o == nil || utils.IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetDescriptionOk() (*string, bool) { + if o == nil || utils.IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *InvoiceCallback) HasDescription() bool { + if o != nil && !utils.IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *InvoiceCallback) SetDescription(v string) { + o.Description = &v +} + +// GetPaidAmount returns the PaidAmount field value if set, zero value otherwise. +func (o *InvoiceCallback) GetPaidAmount() float32 { + if o == nil || utils.IsNil(o.PaidAmount) { + var ret float32 + return ret + } + return *o.PaidAmount +} + +// GetPaidAmountOk returns a tuple with the PaidAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetPaidAmountOk() (*float32, bool) { + if o == nil || utils.IsNil(o.PaidAmount) { + return nil, false + } + return o.PaidAmount, true +} + +// HasPaidAmount returns a boolean if a field has been set. +func (o *InvoiceCallback) HasPaidAmount() bool { + if o != nil && !utils.IsNil(o.PaidAmount) { + return true + } + + return false +} + +// SetPaidAmount gets a reference to the given float32 and assigns it to the PaidAmount field. +func (o *InvoiceCallback) SetPaidAmount(v float32) { + o.PaidAmount = &v +} + +// GetCreated returns the Created field value +func (o *InvoiceCallback) GetCreated() string { + if o == nil { + var ret string + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetCreatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *InvoiceCallback) SetCreated(v string) { + o.Created = v +} + +// GetUpdated returns the Updated field value +func (o *InvoiceCallback) GetUpdated() string { + if o == nil { + var ret string + return ret + } + + return o.Updated +} + +// GetUpdatedOk returns a tuple with the Updated field value +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetUpdatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Updated, true +} + +// SetUpdated sets field value +func (o *InvoiceCallback) SetUpdated(v string) { + o.Updated = v +} + +// GetCurrency returns the Currency field value +func (o *InvoiceCallback) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *InvoiceCallback) SetCurrency(v string) { + o.Currency = v +} + +// GetPaidAt returns the PaidAt field value if set, zero value otherwise. +func (o *InvoiceCallback) GetPaidAt() string { + if o == nil || utils.IsNil(o.PaidAt) { + var ret string + return ret + } + return *o.PaidAt +} + +// GetPaidAtOk returns a tuple with the PaidAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetPaidAtOk() (*string, bool) { + if o == nil || utils.IsNil(o.PaidAt) { + return nil, false + } + return o.PaidAt, true +} + +// HasPaidAt returns a boolean if a field has been set. +func (o *InvoiceCallback) HasPaidAt() bool { + if o != nil && !utils.IsNil(o.PaidAt) { + return true + } + + return false +} + +// SetPaidAt gets a reference to the given string and assigns it to the PaidAt field. +func (o *InvoiceCallback) SetPaidAt(v string) { + o.PaidAt = &v +} + +// GetPaymentMethod returns the PaymentMethod field value if set, zero value otherwise. +func (o *InvoiceCallback) GetPaymentMethod() string { + if o == nil || utils.IsNil(o.PaymentMethod) { + var ret string + return ret + } + return *o.PaymentMethod +} + +// GetPaymentMethodOk returns a tuple with the PaymentMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetPaymentMethodOk() (*string, bool) { + if o == nil || utils.IsNil(o.PaymentMethod) { + return nil, false + } + return o.PaymentMethod, true +} + +// HasPaymentMethod returns a boolean if a field has been set. +func (o *InvoiceCallback) HasPaymentMethod() bool { + if o != nil && !utils.IsNil(o.PaymentMethod) { + return true + } + + return false +} + +// SetPaymentMethod gets a reference to the given string and assigns it to the PaymentMethod field. +func (o *InvoiceCallback) SetPaymentMethod(v string) { + o.PaymentMethod = &v +} + +// GetPaymentChannel returns the PaymentChannel field value if set, zero value otherwise. +func (o *InvoiceCallback) GetPaymentChannel() string { + if o == nil || utils.IsNil(o.PaymentChannel) { + var ret string + return ret + } + return *o.PaymentChannel +} + +// GetPaymentChannelOk returns a tuple with the PaymentChannel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetPaymentChannelOk() (*string, bool) { + if o == nil || utils.IsNil(o.PaymentChannel) { + return nil, false + } + return o.PaymentChannel, true +} + +// HasPaymentChannel returns a boolean if a field has been set. +func (o *InvoiceCallback) HasPaymentChannel() bool { + if o != nil && !utils.IsNil(o.PaymentChannel) { + return true + } + + return false +} + +// SetPaymentChannel gets a reference to the given string and assigns it to the PaymentChannel field. +func (o *InvoiceCallback) SetPaymentChannel(v string) { + o.PaymentChannel = &v +} + +// GetPaymentDestination returns the PaymentDestination field value if set, zero value otherwise. +func (o *InvoiceCallback) GetPaymentDestination() string { + if o == nil || utils.IsNil(o.PaymentDestination) { + var ret string + return ret + } + return *o.PaymentDestination +} + +// GetPaymentDestinationOk returns a tuple with the PaymentDestination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetPaymentDestinationOk() (*string, bool) { + if o == nil || utils.IsNil(o.PaymentDestination) { + return nil, false + } + return o.PaymentDestination, true +} + +// HasPaymentDestination returns a boolean if a field has been set. +func (o *InvoiceCallback) HasPaymentDestination() bool { + if o != nil && !utils.IsNil(o.PaymentDestination) { + return true + } + + return false +} + +// SetPaymentDestination gets a reference to the given string and assigns it to the PaymentDestination field. +func (o *InvoiceCallback) SetPaymentDestination(v string) { + o.PaymentDestination = &v +} + +// GetPaymentDetails returns the PaymentDetails field value if set, zero value otherwise. +func (o *InvoiceCallback) GetPaymentDetails() PaymentDetails { + if o == nil || utils.IsNil(o.PaymentDetails) { + var ret PaymentDetails + return ret + } + return *o.PaymentDetails +} + +// GetPaymentDetailsOk returns a tuple with the PaymentDetails field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetPaymentDetailsOk() (*PaymentDetails, bool) { + if o == nil || utils.IsNil(o.PaymentDetails) { + return nil, false + } + return o.PaymentDetails, true +} + +// HasPaymentDetails returns a boolean if a field has been set. +func (o *InvoiceCallback) HasPaymentDetails() bool { + if o != nil && !utils.IsNil(o.PaymentDetails) { + return true + } + + return false +} + +// SetPaymentDetails gets a reference to the given PaymentDetails and assigns it to the PaymentDetails field. +func (o *InvoiceCallback) SetPaymentDetails(v PaymentDetails) { + o.PaymentDetails = &v +} + +// GetPaymentId returns the PaymentId field value if set, zero value otherwise. +func (o *InvoiceCallback) GetPaymentId() string { + if o == nil || utils.IsNil(o.PaymentId) { + var ret string + return ret + } + return *o.PaymentId +} + +// GetPaymentIdOk returns a tuple with the PaymentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetPaymentIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.PaymentId) { + return nil, false + } + return o.PaymentId, true +} + +// HasPaymentId returns a boolean if a field has been set. +func (o *InvoiceCallback) HasPaymentId() bool { + if o != nil && !utils.IsNil(o.PaymentId) { + return true + } + + return false +} + +// SetPaymentId gets a reference to the given string and assigns it to the PaymentId field. +func (o *InvoiceCallback) SetPaymentId(v string) { + o.PaymentId = &v +} + +// GetSuccessRedirectUrl returns the SuccessRedirectUrl field value if set, zero value otherwise. +func (o *InvoiceCallback) GetSuccessRedirectUrl() string { + if o == nil || utils.IsNil(o.SuccessRedirectUrl) { + var ret string + return ret + } + return *o.SuccessRedirectUrl +} + +// GetSuccessRedirectUrlOk returns a tuple with the SuccessRedirectUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetSuccessRedirectUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.SuccessRedirectUrl) { + return nil, false + } + return o.SuccessRedirectUrl, true +} + +// HasSuccessRedirectUrl returns a boolean if a field has been set. +func (o *InvoiceCallback) HasSuccessRedirectUrl() bool { + if o != nil && !utils.IsNil(o.SuccessRedirectUrl) { + return true + } + + return false +} + +// SetSuccessRedirectUrl gets a reference to the given string and assigns it to the SuccessRedirectUrl field. +func (o *InvoiceCallback) SetSuccessRedirectUrl(v string) { + o.SuccessRedirectUrl = &v +} + +// GetFailureRedirectUrl returns the FailureRedirectUrl field value if set, zero value otherwise. +func (o *InvoiceCallback) GetFailureRedirectUrl() string { + if o == nil || utils.IsNil(o.FailureRedirectUrl) { + var ret string + return ret + } + return *o.FailureRedirectUrl +} + +// GetFailureRedirectUrlOk returns a tuple with the FailureRedirectUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetFailureRedirectUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.FailureRedirectUrl) { + return nil, false + } + return o.FailureRedirectUrl, true +} + +// HasFailureRedirectUrl returns a boolean if a field has been set. +func (o *InvoiceCallback) HasFailureRedirectUrl() bool { + if o != nil && !utils.IsNil(o.FailureRedirectUrl) { + return true + } + + return false +} + +// SetFailureRedirectUrl gets a reference to the given string and assigns it to the FailureRedirectUrl field. +func (o *InvoiceCallback) SetFailureRedirectUrl(v string) { + o.FailureRedirectUrl = &v +} + +// GetCreditCardChargeId returns the CreditCardChargeId field value if set, zero value otherwise. +func (o *InvoiceCallback) GetCreditCardChargeId() string { + if o == nil || utils.IsNil(o.CreditCardChargeId) { + var ret string + return ret + } + return *o.CreditCardChargeId +} + +// GetCreditCardChargeIdOk returns a tuple with the CreditCardChargeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetCreditCardChargeIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.CreditCardChargeId) { + return nil, false + } + return o.CreditCardChargeId, true +} + +// HasCreditCardChargeId returns a boolean if a field has been set. +func (o *InvoiceCallback) HasCreditCardChargeId() bool { + if o != nil && !utils.IsNil(o.CreditCardChargeId) { + return true + } + + return false +} + +// SetCreditCardChargeId gets a reference to the given string and assigns it to the CreditCardChargeId field. +func (o *InvoiceCallback) SetCreditCardChargeId(v string) { + o.CreditCardChargeId = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *InvoiceCallback) GetItems() []InvoiceCallbackItem { + if o == nil || utils.IsNil(o.Items) { + var ret []InvoiceCallbackItem + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetItemsOk() ([]InvoiceCallbackItem, bool) { + if o == nil || utils.IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *InvoiceCallback) HasItems() bool { + if o != nil && !utils.IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []InvoiceCallbackItem and assigns it to the Items field. +func (o *InvoiceCallback) SetItems(v []InvoiceCallbackItem) { + o.Items = v +} + +// GetFees returns the Fees field value if set, zero value otherwise. +func (o *InvoiceCallback) GetFees() []InvoiceFee { + if o == nil || utils.IsNil(o.Fees) { + var ret []InvoiceFee + return ret + } + return o.Fees +} + +// GetFeesOk returns a tuple with the Fees field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetFeesOk() ([]InvoiceFee, bool) { + if o == nil || utils.IsNil(o.Fees) { + return nil, false + } + return o.Fees, true +} + +// HasFees returns a boolean if a field has been set. +func (o *InvoiceCallback) HasFees() bool { + if o != nil && !utils.IsNil(o.Fees) { + return true + } + + return false +} + +// SetFees gets a reference to the given []InvoiceFee and assigns it to the Fees field. +func (o *InvoiceCallback) SetFees(v []InvoiceFee) { + o.Fees = v +} + +// GetShouldAuthenticateCreditCard returns the ShouldAuthenticateCreditCard field value if set, zero value otherwise. +func (o *InvoiceCallback) GetShouldAuthenticateCreditCard() bool { + if o == nil || utils.IsNil(o.ShouldAuthenticateCreditCard) { + var ret bool + return ret + } + return *o.ShouldAuthenticateCreditCard +} + +// GetShouldAuthenticateCreditCardOk returns a tuple with the ShouldAuthenticateCreditCard field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetShouldAuthenticateCreditCardOk() (*bool, bool) { + if o == nil || utils.IsNil(o.ShouldAuthenticateCreditCard) { + return nil, false + } + return o.ShouldAuthenticateCreditCard, true +} + +// HasShouldAuthenticateCreditCard returns a boolean if a field has been set. +func (o *InvoiceCallback) HasShouldAuthenticateCreditCard() bool { + if o != nil && !utils.IsNil(o.ShouldAuthenticateCreditCard) { + return true + } + + return false +} + +// SetShouldAuthenticateCreditCard gets a reference to the given bool and assigns it to the ShouldAuthenticateCreditCard field. +func (o *InvoiceCallback) SetShouldAuthenticateCreditCard(v bool) { + o.ShouldAuthenticateCreditCard = &v +} + +// GetBankCode returns the BankCode field value if set, zero value otherwise. +func (o *InvoiceCallback) GetBankCode() string { + if o == nil || utils.IsNil(o.BankCode) { + var ret string + return ret + } + return *o.BankCode +} + +// GetBankCodeOk returns a tuple with the BankCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetBankCodeOk() (*string, bool) { + if o == nil || utils.IsNil(o.BankCode) { + return nil, false + } + return o.BankCode, true +} + +// HasBankCode returns a boolean if a field has been set. +func (o *InvoiceCallback) HasBankCode() bool { + if o != nil && !utils.IsNil(o.BankCode) { + return true + } + + return false +} + +// SetBankCode gets a reference to the given string and assigns it to the BankCode field. +func (o *InvoiceCallback) SetBankCode(v string) { + o.BankCode = &v +} + +// GetEwalletType returns the EwalletType field value if set, zero value otherwise. +func (o *InvoiceCallback) GetEwalletType() string { + if o == nil || utils.IsNil(o.EwalletType) { + var ret string + return ret + } + return *o.EwalletType +} + +// GetEwalletTypeOk returns a tuple with the EwalletType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetEwalletTypeOk() (*string, bool) { + if o == nil || utils.IsNil(o.EwalletType) { + return nil, false + } + return o.EwalletType, true +} + +// HasEwalletType returns a boolean if a field has been set. +func (o *InvoiceCallback) HasEwalletType() bool { + if o != nil && !utils.IsNil(o.EwalletType) { + return true + } + + return false +} + +// SetEwalletType gets a reference to the given string and assigns it to the EwalletType field. +func (o *InvoiceCallback) SetEwalletType(v string) { + o.EwalletType = &v +} + +// GetOnDemandLink returns the OnDemandLink field value if set, zero value otherwise. +func (o *InvoiceCallback) GetOnDemandLink() string { + if o == nil || utils.IsNil(o.OnDemandLink) { + var ret string + return ret + } + return *o.OnDemandLink +} + +// GetOnDemandLinkOk returns a tuple with the OnDemandLink field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetOnDemandLinkOk() (*string, bool) { + if o == nil || utils.IsNil(o.OnDemandLink) { + return nil, false + } + return o.OnDemandLink, true +} + +// HasOnDemandLink returns a boolean if a field has been set. +func (o *InvoiceCallback) HasOnDemandLink() bool { + if o != nil && !utils.IsNil(o.OnDemandLink) { + return true + } + + return false +} + +// SetOnDemandLink gets a reference to the given string and assigns it to the OnDemandLink field. +func (o *InvoiceCallback) SetOnDemandLink(v string) { + o.OnDemandLink = &v +} + +// GetRecurringPaymentId returns the RecurringPaymentId field value if set, zero value otherwise. +func (o *InvoiceCallback) GetRecurringPaymentId() string { + if o == nil || utils.IsNil(o.RecurringPaymentId) { + var ret string + return ret + } + return *o.RecurringPaymentId +} + +// GetRecurringPaymentIdOk returns a tuple with the RecurringPaymentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallback) GetRecurringPaymentIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.RecurringPaymentId) { + return nil, false + } + return o.RecurringPaymentId, true +} + +// HasRecurringPaymentId returns a boolean if a field has been set. +func (o *InvoiceCallback) HasRecurringPaymentId() bool { + if o != nil && !utils.IsNil(o.RecurringPaymentId) { + return true + } + + return false +} + +// SetRecurringPaymentId gets a reference to the given string and assigns it to the RecurringPaymentId field. +func (o *InvoiceCallback) SetRecurringPaymentId(v string) { + o.RecurringPaymentId = &v +} + +func (o InvoiceCallback) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvoiceCallback) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["external_id"] = o.ExternalId + toSerialize["user_id"] = o.UserId + toSerialize["status"] = o.Status + toSerialize["merchant_name"] = o.MerchantName + toSerialize["amount"] = o.Amount + if !utils.IsNil(o.PayerEmail) { + toSerialize["payer_email"] = o.PayerEmail + } + if !utils.IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !utils.IsNil(o.PaidAmount) { + toSerialize["paid_amount"] = o.PaidAmount + } + toSerialize["created"] = o.Created + toSerialize["updated"] = o.Updated + toSerialize["currency"] = o.Currency + if !utils.IsNil(o.PaidAt) { + toSerialize["paid_at"] = o.PaidAt + } + if !utils.IsNil(o.PaymentMethod) { + toSerialize["payment_method"] = o.PaymentMethod + } + if !utils.IsNil(o.PaymentChannel) { + toSerialize["payment_channel"] = o.PaymentChannel + } + if !utils.IsNil(o.PaymentDestination) { + toSerialize["payment_destination"] = o.PaymentDestination + } + if !utils.IsNil(o.PaymentDetails) { + toSerialize["payment_details"] = o.PaymentDetails + } + if !utils.IsNil(o.PaymentId) { + toSerialize["payment_id"] = o.PaymentId + } + if !utils.IsNil(o.SuccessRedirectUrl) { + toSerialize["success_redirect_url"] = o.SuccessRedirectUrl + } + if !utils.IsNil(o.FailureRedirectUrl) { + toSerialize["failure_redirect_url"] = o.FailureRedirectUrl + } + if !utils.IsNil(o.CreditCardChargeId) { + toSerialize["credit_card_charge_id"] = o.CreditCardChargeId + } + if !utils.IsNil(o.Items) { + toSerialize["items"] = o.Items + } + if !utils.IsNil(o.Fees) { + toSerialize["fees"] = o.Fees + } + if !utils.IsNil(o.ShouldAuthenticateCreditCard) { + toSerialize["should_authenticate_credit_card"] = o.ShouldAuthenticateCreditCard + } + if !utils.IsNil(o.BankCode) { + toSerialize["bank_code"] = o.BankCode + } + if !utils.IsNil(o.EwalletType) { + toSerialize["ewallet_type"] = o.EwalletType + } + if !utils.IsNil(o.OnDemandLink) { + toSerialize["on_demand_link"] = o.OnDemandLink + } + if !utils.IsNil(o.RecurringPaymentId) { + toSerialize["recurring_payment_id"] = o.RecurringPaymentId + } + return toSerialize, nil +} + +type NullableInvoiceCallback struct { + value *InvoiceCallback + isSet bool +} + +func (v NullableInvoiceCallback) Get() *InvoiceCallback { + return v.value +} + +func (v *NullableInvoiceCallback) Set(val *InvoiceCallback) { + v.value = val + v.isSet = true +} + +func (v NullableInvoiceCallback) IsSet() bool { + return v.isSet +} + +func (v *NullableInvoiceCallback) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvoiceCallback(val *InvoiceCallback) *NullableInvoiceCallback { + return &NullableInvoiceCallback{value: val, isSet: true} +} + +func (v NullableInvoiceCallback) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvoiceCallback) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_invoice_callback_item.go b/invoice/model_invoice_callback_item.go new file mode 100644 index 00000000..fe1759ed --- /dev/null +++ b/invoice/model_invoice_callback_item.go @@ -0,0 +1,249 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + + +package invoice + +import ( + "encoding/json" + + utils "github.com/xendit/xendit-go/v3/utils" +) + +// checks if the InvoiceCallbackItem type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &InvoiceCallbackItem{} + +// InvoiceCallbackItem An object representing an item within an invoice. +type InvoiceCallbackItem struct { + // The name of the item. + Name string `json:"name"` + // The price of the item. + Price float32 `json:"price"` + // The quantity of the item. Must be greater than or equal to 0. + Quantity float32 `json:"quantity"` + // The URL associated with the item. + Url *string `json:"url,omitempty"` + // The category of the item. + Category *string `json:"category,omitempty"` +} + +// NewInvoiceCallbackItem instantiates a new InvoiceCallbackItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvoiceCallbackItem(name string, price float32, quantity float32) *InvoiceCallbackItem { + this := InvoiceCallbackItem{} + this.Name = name + this.Price = price + this.Quantity = quantity + return &this +} + +// NewInvoiceCallbackItemWithDefaults instantiates a new InvoiceCallbackItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvoiceCallbackItemWithDefaults() *InvoiceCallbackItem { + this := InvoiceCallbackItem{} + return &this +} + +// GetName returns the Name field value +func (o *InvoiceCallbackItem) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *InvoiceCallbackItem) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *InvoiceCallbackItem) SetName(v string) { + o.Name = v +} + +// GetPrice returns the Price field value +func (o *InvoiceCallbackItem) GetPrice() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Price +} + +// GetPriceOk returns a tuple with the Price field value +// and a boolean to check if the value has been set. +func (o *InvoiceCallbackItem) GetPriceOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Price, true +} + +// SetPrice sets field value +func (o *InvoiceCallbackItem) SetPrice(v float32) { + o.Price = v +} + +// GetQuantity returns the Quantity field value +func (o *InvoiceCallbackItem) GetQuantity() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value +// and a boolean to check if the value has been set. +func (o *InvoiceCallbackItem) GetQuantityOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Quantity, true +} + +// SetQuantity sets field value +func (o *InvoiceCallbackItem) SetQuantity(v float32) { + o.Quantity = v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *InvoiceCallbackItem) GetUrl() string { + if o == nil || utils.IsNil(o.Url) { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallbackItem) GetUrlOk() (*string, bool) { + if o == nil || utils.IsNil(o.Url) { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *InvoiceCallbackItem) HasUrl() bool { + if o != nil && !utils.IsNil(o.Url) { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *InvoiceCallbackItem) SetUrl(v string) { + o.Url = &v +} + +// GetCategory returns the Category field value if set, zero value otherwise. +func (o *InvoiceCallbackItem) GetCategory() string { + if o == nil || utils.IsNil(o.Category) { + var ret string + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoiceCallbackItem) GetCategoryOk() (*string, bool) { + if o == nil || utils.IsNil(o.Category) { + return nil, false + } + return o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *InvoiceCallbackItem) HasCategory() bool { + if o != nil && !utils.IsNil(o.Category) { + return true + } + + return false +} + +// SetCategory gets a reference to the given string and assigns it to the Category field. +func (o *InvoiceCallbackItem) SetCategory(v string) { + o.Category = &v +} + +func (o InvoiceCallbackItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvoiceCallbackItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["price"] = o.Price + toSerialize["quantity"] = o.Quantity + if !utils.IsNil(o.Url) { + toSerialize["url"] = o.Url + } + if !utils.IsNil(o.Category) { + toSerialize["category"] = o.Category + } + return toSerialize, nil +} + +type NullableInvoiceCallbackItem struct { + value *InvoiceCallbackItem + isSet bool +} + +func (v NullableInvoiceCallbackItem) Get() *InvoiceCallbackItem { + return v.value +} + +func (v *NullableInvoiceCallbackItem) Set(val *InvoiceCallbackItem) { + v.value = val + v.isSet = true +} + +func (v NullableInvoiceCallbackItem) IsSet() bool { + return v.isSet +} + +func (v *NullableInvoiceCallbackItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvoiceCallbackItem(val *InvoiceCallbackItem) *NullableInvoiceCallbackItem { + return &NullableInvoiceCallbackItem{value: val, isSet: true} +} + +func (v NullableInvoiceCallbackItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvoiceCallbackItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/invoice/model_payment_details.go b/invoice/model_payment_details.go new file mode 100644 index 00000000..0cfb1a5f --- /dev/null +++ b/invoice/model_payment_details.go @@ -0,0 +1,165 @@ +/* +xendit-invoice-service + +xendit-invoice-service descriptions + +API version: 1.5.0 +*/ + + +package invoice + +import ( + "encoding/json" + + utils "github.com/xendit/xendit-go/v3/utils" +) + +// checks if the PaymentDetails type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentDetails{} + +// PaymentDetails An object representing payment details. +type PaymentDetails struct { + // The unique identifier or reference ID associated with the payment receipt. + ReceiptId *string `json:"receipt_id,omitempty"` + // The source or method of payment. + Source *string `json:"source,omitempty"` +} + +// NewPaymentDetails instantiates a new PaymentDetails object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentDetails() *PaymentDetails { + this := PaymentDetails{} + return &this +} + +// NewPaymentDetailsWithDefaults instantiates a new PaymentDetails object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentDetailsWithDefaults() *PaymentDetails { + this := PaymentDetails{} + return &this +} + +// GetReceiptId returns the ReceiptId field value if set, zero value otherwise. +func (o *PaymentDetails) GetReceiptId() string { + if o == nil || utils.IsNil(o.ReceiptId) { + var ret string + return ret + } + return *o.ReceiptId +} + +// GetReceiptIdOk returns a tuple with the ReceiptId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentDetails) GetReceiptIdOk() (*string, bool) { + if o == nil || utils.IsNil(o.ReceiptId) { + return nil, false + } + return o.ReceiptId, true +} + +// HasReceiptId returns a boolean if a field has been set. +func (o *PaymentDetails) HasReceiptId() bool { + if o != nil && !utils.IsNil(o.ReceiptId) { + return true + } + + return false +} + +// SetReceiptId gets a reference to the given string and assigns it to the ReceiptId field. +func (o *PaymentDetails) SetReceiptId(v string) { + o.ReceiptId = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PaymentDetails) GetSource() string { + if o == nil || utils.IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentDetails) GetSourceOk() (*string, bool) { + if o == nil || utils.IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PaymentDetails) HasSource() bool { + if o != nil && !utils.IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PaymentDetails) SetSource(v string) { + o.Source = &v +} + +func (o PaymentDetails) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentDetails) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.ReceiptId) { + toSerialize["receipt_id"] = o.ReceiptId + } + if !utils.IsNil(o.Source) { + toSerialize["source"] = o.Source + } + return toSerialize, nil +} + +type NullablePaymentDetails struct { + value *PaymentDetails + isSet bool +} + +func (v NullablePaymentDetails) Get() *PaymentDetails { + return v.value +} + +func (v *NullablePaymentDetails) Set(val *PaymentDetails) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentDetails) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentDetails) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentDetails(val *PaymentDetails) *NullablePaymentDetails { + return &NullablePaymentDetails{value: val, isSet: true} +} + +func (v NullablePaymentDetails) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentDetails) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_method/model_payment_method_callback.go b/payment_method/model_payment_method_callback.go new file mode 100644 index 00000000..d86529da --- /dev/null +++ b/payment_method/model_payment_method_callback.go @@ -0,0 +1,210 @@ +/* +Payment Method Service v2 + +This API is used for Payment Method Service v2 + +API version: 2.91.2 +*/ + + +package payment_method + +import ( + "encoding/json" + + utils "github.com/xendit/xendit-go/v3/utils" +) + +// checks if the PaymentMethodCallback type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentMethodCallback{} + +// PaymentMethodCallback Callback for active or expired E-Wallet or Direct Debit account linking, Virtual Accounts or QR strings +type PaymentMethodCallback struct { + // Identifies the event that triggered a notification to the merchant + Event string `json:"event"` + // business_id + BusinessId string `json:"business_id"` + Created string `json:"created"` + Data *PaymentMethod `json:"data,omitempty"` +} + +// NewPaymentMethodCallback instantiates a new PaymentMethodCallback object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentMethodCallback(event string, businessId string, created string) *PaymentMethodCallback { + this := PaymentMethodCallback{} + this.Event = event + this.BusinessId = businessId + this.Created = created + return &this +} + +// NewPaymentMethodCallbackWithDefaults instantiates a new PaymentMethodCallback object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentMethodCallbackWithDefaults() *PaymentMethodCallback { + this := PaymentMethodCallback{} + return &this +} + +// GetEvent returns the Event field value +func (o *PaymentMethodCallback) GetEvent() string { + if o == nil { + var ret string + return ret + } + + return o.Event +} + +// GetEventOk returns a tuple with the Event field value +// and a boolean to check if the value has been set. +func (o *PaymentMethodCallback) GetEventOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Event, true +} + +// SetEvent sets field value +func (o *PaymentMethodCallback) SetEvent(v string) { + o.Event = v +} + +// GetBusinessId returns the BusinessId field value +func (o *PaymentMethodCallback) GetBusinessId() string { + if o == nil { + var ret string + return ret + } + + return o.BusinessId +} + +// GetBusinessIdOk returns a tuple with the BusinessId field value +// and a boolean to check if the value has been set. +func (o *PaymentMethodCallback) GetBusinessIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BusinessId, true +} + +// SetBusinessId sets field value +func (o *PaymentMethodCallback) SetBusinessId(v string) { + o.BusinessId = v +} + +// GetCreated returns the Created field value +func (o *PaymentMethodCallback) GetCreated() string { + if o == nil { + var ret string + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *PaymentMethodCallback) GetCreatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *PaymentMethodCallback) SetCreated(v string) { + o.Created = v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *PaymentMethodCallback) GetData() PaymentMethod { + if o == nil || utils.IsNil(o.Data) { + var ret PaymentMethod + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentMethodCallback) GetDataOk() (*PaymentMethod, bool) { + if o == nil || utils.IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *PaymentMethodCallback) HasData() bool { + if o != nil && !utils.IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given PaymentMethod and assigns it to the Data field. +func (o *PaymentMethodCallback) SetData(v PaymentMethod) { + o.Data = &v +} + +func (o PaymentMethodCallback) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentMethodCallback) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["event"] = o.Event + toSerialize["business_id"] = o.BusinessId + toSerialize["created"] = o.Created + if !utils.IsNil(o.Data) { + toSerialize["data"] = o.Data + } + return toSerialize, nil +} + +type NullablePaymentMethodCallback struct { + value *PaymentMethodCallback + isSet bool +} + +func (v NullablePaymentMethodCallback) Get() *PaymentMethodCallback { + return v.value +} + +func (v *NullablePaymentMethodCallback) Set(val *PaymentMethodCallback) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentMethodCallback) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentMethodCallback) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentMethodCallback(val *PaymentMethodCallback) *NullablePaymentMethodCallback { + return &NullablePaymentMethodCallback{value: val, isSet: true} +} + +func (v NullablePaymentMethodCallback) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentMethodCallback) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_capture.go b/payment_request/model_capture.go index c0bd09cc..683b7afb 100644 --- a/payment_request/model_capture.go +++ b/payment_request/model_capture.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_capture_list_response.go b/payment_request/model_capture_list_response.go index 14bd156c..2864e4a8 100644 --- a/payment_request/model_capture_list_response.go +++ b/payment_request/model_capture_list_response.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_capture_parameters.go b/payment_request/model_capture_parameters.go index c0d71d17..5ca8783a 100644 --- a/payment_request/model_capture_parameters.go +++ b/payment_request/model_capture_parameters.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_card.go b/payment_request/model_card.go index 56ea91f3..63d0e67c 100644 --- a/payment_request/model_card.go +++ b/payment_request/model_card.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_card_channel_properties.go b/payment_request/model_card_channel_properties.go index 5c42a440..011e08cb 100644 --- a/payment_request/model_card_channel_properties.go +++ b/payment_request/model_card_channel_properties.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_card_information.go b/payment_request/model_card_information.go index 83abf71e..cf744315 100644 --- a/payment_request/model_card_information.go +++ b/payment_request/model_card_information.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_card_verification_results.go b/payment_request/model_card_verification_results.go index 9cd56d69..186182ed 100644 --- a/payment_request/model_card_verification_results.go +++ b/payment_request/model_card_verification_results.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_card_verification_results_three_d_secure.go b/payment_request/model_card_verification_results_three_d_secure.go index 6063cdbb..6661c1f7 100644 --- a/payment_request/model_card_verification_results_three_d_secure.go +++ b/payment_request/model_card_verification_results_three_d_secure.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_direct_debit.go b/payment_request/model_direct_debit.go index 409985fa..0fea3211 100644 --- a/payment_request/model_direct_debit.go +++ b/payment_request/model_direct_debit.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_direct_debit_all_of.go b/payment_request/model_direct_debit_all_of.go index 79fec0d5..99a0a618 100644 --- a/payment_request/model_direct_debit_all_of.go +++ b/payment_request/model_direct_debit_all_of.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_direct_debit_bank_account.go b/payment_request/model_direct_debit_bank_account.go index 8178e3e5..6a075a8a 100644 --- a/payment_request/model_direct_debit_bank_account.go +++ b/payment_request/model_direct_debit_bank_account.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_direct_debit_channel_code.go b/payment_request/model_direct_debit_channel_code.go index c807444d..80d3ac58 100644 --- a/payment_request/model_direct_debit_channel_code.go +++ b/payment_request/model_direct_debit_channel_code.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_direct_debit_channel_properties.go b/payment_request/model_direct_debit_channel_properties.go index 41ca02b8..0bce3baf 100644 --- a/payment_request/model_direct_debit_channel_properties.go +++ b/payment_request/model_direct_debit_channel_properties.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_direct_debit_channel_properties_bank_account.go b/payment_request/model_direct_debit_channel_properties_bank_account.go index bef8ba52..25d43704 100644 --- a/payment_request/model_direct_debit_channel_properties_bank_account.go +++ b/payment_request/model_direct_debit_channel_properties_bank_account.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_direct_debit_channel_properties_bank_redirect.go b/payment_request/model_direct_debit_channel_properties_bank_redirect.go index c441d55f..12177cf7 100644 --- a/payment_request/model_direct_debit_channel_properties_bank_redirect.go +++ b/payment_request/model_direct_debit_channel_properties_bank_redirect.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_direct_debit_channel_properties_debit_card.go b/payment_request/model_direct_debit_channel_properties_debit_card.go index c060b37a..15581f29 100644 --- a/payment_request/model_direct_debit_channel_properties_debit_card.go +++ b/payment_request/model_direct_debit_channel_properties_debit_card.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_direct_debit_debit_card.go b/payment_request/model_direct_debit_debit_card.go index 1e5d67a8..360a1c10 100644 --- a/payment_request/model_direct_debit_debit_card.go +++ b/payment_request/model_direct_debit_debit_card.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_direct_debit_parameters.go b/payment_request/model_direct_debit_parameters.go index 3e45efcb..513159f4 100644 --- a/payment_request/model_direct_debit_parameters.go +++ b/payment_request/model_direct_debit_parameters.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_direct_debit_type.go b/payment_request/model_direct_debit_type.go index 6baee2ff..bfe731bf 100644 --- a/payment_request/model_direct_debit_type.go +++ b/payment_request/model_direct_debit_type.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_e_wallet.go b/payment_request/model_e_wallet.go index 441f87dc..b14548ed 100644 --- a/payment_request/model_e_wallet.go +++ b/payment_request/model_e_wallet.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_e_wallet_account.go b/payment_request/model_e_wallet_account.go index dc90569e..e833ed93 100644 --- a/payment_request/model_e_wallet_account.go +++ b/payment_request/model_e_wallet_account.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_e_wallet_all_of.go b/payment_request/model_e_wallet_all_of.go index 86b58c8c..41aaa793 100644 --- a/payment_request/model_e_wallet_all_of.go +++ b/payment_request/model_e_wallet_all_of.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_e_wallet_channel_code.go b/payment_request/model_e_wallet_channel_code.go index 950f07e3..b6aa6ae7 100644 --- a/payment_request/model_e_wallet_channel_code.go +++ b/payment_request/model_e_wallet_channel_code.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_e_wallet_channel_properties.go b/payment_request/model_e_wallet_channel_properties.go index fd664137..86e94f16 100644 --- a/payment_request/model_e_wallet_channel_properties.go +++ b/payment_request/model_e_wallet_channel_properties.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_e_wallet_parameters.go b/payment_request/model_e_wallet_parameters.go index e6a8a3e8..e95118d4 100644 --- a/payment_request/model_e_wallet_parameters.go +++ b/payment_request/model_e_wallet_parameters.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_error.go b/payment_request/model_error.go index 874ed476..c5fb500d 100644 --- a/payment_request/model_error.go +++ b/payment_request/model_error.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_invoice_partner_metadata.go b/payment_request/model_invoice_partner_metadata.go new file mode 100644 index 00000000..05a255f9 --- /dev/null +++ b/payment_request/model_invoice_partner_metadata.go @@ -0,0 +1,127 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.45.2 +*/ + + +package payment_request + +import ( + "encoding/json" + + utils "github.com/xendit/xendit-go/v3/utils" +) + +// checks if the InvoicePartnerMetadata type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &InvoicePartnerMetadata{} + +// InvoicePartnerMetadata struct for InvoicePartnerMetadata +type InvoicePartnerMetadata struct { + Notes *string `json:"notes,omitempty"` +} + +// NewInvoicePartnerMetadata instantiates a new InvoicePartnerMetadata object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvoicePartnerMetadata() *InvoicePartnerMetadata { + this := InvoicePartnerMetadata{} + return &this +} + +// NewInvoicePartnerMetadataWithDefaults instantiates a new InvoicePartnerMetadata object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvoicePartnerMetadataWithDefaults() *InvoicePartnerMetadata { + this := InvoicePartnerMetadata{} + return &this +} + +// GetNotes returns the Notes field value if set, zero value otherwise. +func (o *InvoicePartnerMetadata) GetNotes() string { + if o == nil || utils.IsNil(o.Notes) { + var ret string + return ret + } + return *o.Notes +} + +// GetNotesOk returns a tuple with the Notes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvoicePartnerMetadata) GetNotesOk() (*string, bool) { + if o == nil || utils.IsNil(o.Notes) { + return nil, false + } + return o.Notes, true +} + +// HasNotes returns a boolean if a field has been set. +func (o *InvoicePartnerMetadata) HasNotes() bool { + if o != nil && !utils.IsNil(o.Notes) { + return true + } + + return false +} + +// SetNotes gets a reference to the given string and assigns it to the Notes field. +func (o *InvoicePartnerMetadata) SetNotes(v string) { + o.Notes = &v +} + +func (o InvoicePartnerMetadata) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvoicePartnerMetadata) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !utils.IsNil(o.Notes) { + toSerialize["notes"] = o.Notes + } + return toSerialize, nil +} + +type NullableInvoicePartnerMetadata struct { + value *InvoicePartnerMetadata + isSet bool +} + +func (v NullableInvoicePartnerMetadata) Get() *InvoicePartnerMetadata { + return v.value +} + +func (v *NullableInvoicePartnerMetadata) Set(val *InvoicePartnerMetadata) { + v.value = val + v.isSet = true +} + +func (v NullableInvoicePartnerMetadata) IsSet() bool { + return v.isSet +} + +func (v *NullableInvoicePartnerMetadata) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvoicePartnerMetadata(val *InvoicePartnerMetadata) *NullableInvoicePartnerMetadata { + return &NullableInvoicePartnerMetadata{value: val, isSet: true} +} + +func (v NullableInvoicePartnerMetadata) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvoicePartnerMetadata) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_over_the_counter.go b/payment_request/model_over_the_counter.go index d89b1ee8..350b1d12 100644 --- a/payment_request/model_over_the_counter.go +++ b/payment_request/model_over_the_counter.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_over_the_counter_channel_code.go b/payment_request/model_over_the_counter_channel_code.go index 2665a93d..9f9eb079 100644 --- a/payment_request/model_over_the_counter_channel_code.go +++ b/payment_request/model_over_the_counter_channel_code.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_over_the_counter_channel_properties.go b/payment_request/model_over_the_counter_channel_properties.go index 52d8c33e..89813511 100644 --- a/payment_request/model_over_the_counter_channel_properties.go +++ b/payment_request/model_over_the_counter_channel_properties.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_over_the_counter_parameters.go b/payment_request/model_over_the_counter_parameters.go index 18c1973a..2ba43a68 100644 --- a/payment_request/model_over_the_counter_parameters.go +++ b/payment_request/model_over_the_counter_parameters.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_callback.go b/payment_request/model_payment_callback.go new file mode 100644 index 00000000..7489d1aa --- /dev/null +++ b/payment_request/model_payment_callback.go @@ -0,0 +1,210 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.45.2 +*/ + + +package payment_request + +import ( + "encoding/json" + + utils "github.com/xendit/xendit-go/v3/utils" +) + +// checks if the PaymentCallback type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentCallback{} + +// PaymentCallback Callback for successful or failed payments made via the Payments API +type PaymentCallback struct { + // Identifies the event that triggered a notification to the merchant + Event string `json:"event"` + // business_id + BusinessId string `json:"business_id"` + Created string `json:"created"` + Data *PaymentCallbackData `json:"data,omitempty"` +} + +// NewPaymentCallback instantiates a new PaymentCallback object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentCallback(event string, businessId string, created string) *PaymentCallback { + this := PaymentCallback{} + this.Event = event + this.BusinessId = businessId + this.Created = created + return &this +} + +// NewPaymentCallbackWithDefaults instantiates a new PaymentCallback object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentCallbackWithDefaults() *PaymentCallback { + this := PaymentCallback{} + return &this +} + +// GetEvent returns the Event field value +func (o *PaymentCallback) GetEvent() string { + if o == nil { + var ret string + return ret + } + + return o.Event +} + +// GetEventOk returns a tuple with the Event field value +// and a boolean to check if the value has been set. +func (o *PaymentCallback) GetEventOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Event, true +} + +// SetEvent sets field value +func (o *PaymentCallback) SetEvent(v string) { + o.Event = v +} + +// GetBusinessId returns the BusinessId field value +func (o *PaymentCallback) GetBusinessId() string { + if o == nil { + var ret string + return ret + } + + return o.BusinessId +} + +// GetBusinessIdOk returns a tuple with the BusinessId field value +// and a boolean to check if the value has been set. +func (o *PaymentCallback) GetBusinessIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BusinessId, true +} + +// SetBusinessId sets field value +func (o *PaymentCallback) SetBusinessId(v string) { + o.BusinessId = v +} + +// GetCreated returns the Created field value +func (o *PaymentCallback) GetCreated() string { + if o == nil { + var ret string + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *PaymentCallback) GetCreatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *PaymentCallback) SetCreated(v string) { + o.Created = v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *PaymentCallback) GetData() PaymentCallbackData { + if o == nil || utils.IsNil(o.Data) { + var ret PaymentCallbackData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PaymentCallback) GetDataOk() (*PaymentCallbackData, bool) { + if o == nil || utils.IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *PaymentCallback) HasData() bool { + if o != nil && !utils.IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given PaymentCallbackData and assigns it to the Data field. +func (o *PaymentCallback) SetData(v PaymentCallbackData) { + o.Data = &v +} + +func (o PaymentCallback) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentCallback) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["event"] = o.Event + toSerialize["business_id"] = o.BusinessId + toSerialize["created"] = o.Created + if !utils.IsNil(o.Data) { + toSerialize["data"] = o.Data + } + return toSerialize, nil +} + +type NullablePaymentCallback struct { + value *PaymentCallback + isSet bool +} + +func (v NullablePaymentCallback) Get() *PaymentCallback { + return v.value +} + +func (v *NullablePaymentCallback) Set(val *PaymentCallback) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentCallback) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentCallback) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentCallback(val *PaymentCallback) *NullablePaymentCallback { + return &NullablePaymentCallback{value: val, isSet: true} +} + +func (v NullablePaymentCallback) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentCallback) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_callback_data.go b/payment_request/model_payment_callback_data.go new file mode 100644 index 00000000..c9ee74a2 --- /dev/null +++ b/payment_request/model_payment_callback_data.go @@ -0,0 +1,583 @@ +/* +Payment Requests + +This API is used for Payment Requests + +API version: 1.45.2 +*/ + + +package payment_request + +import ( + "encoding/json" + + utils "github.com/xendit/xendit-go/v3/utils" +) + +// checks if the PaymentCallbackData type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &PaymentCallbackData{} + +// PaymentCallbackData Represents the actual funds transaction/attempt made to a payment method +type PaymentCallbackData struct { + Id string `json:"id"` + PaymentRequestId NullableString `json:"payment_request_id,omitempty"` + ReferenceId string `json:"reference_id"` + CustomerId NullableString `json:"customer_id,omitempty"` + Currency string `json:"currency"` + Amount float64 `json:"amount"` + Country string `json:"country"` + Status string `json:"status"` + PaymentMethod PaymentMethod `json:"payment_method"` + ChannelProperties NullablePaymentRequestChannelProperties `json:"channel_properties,omitempty"` + PaymentDetail map[string]interface{} `json:"payment_detail,omitempty"` + FailureCode map[string]interface{} `json:"failure_code,omitempty"` + Created string `json:"created"` + Updated string `json:"updated"` + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +// NewPaymentCallbackData instantiates a new PaymentCallbackData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaymentCallbackData(id string, referenceId string, currency string, amount float64, country string, status string, paymentMethod PaymentMethod, created string, updated string) *PaymentCallbackData { + this := PaymentCallbackData{} + this.Id = id + this.ReferenceId = referenceId + this.Currency = currency + this.Amount = amount + this.Country = country + this.Status = status + this.PaymentMethod = paymentMethod + this.Created = created + this.Updated = updated + return &this +} + +// NewPaymentCallbackDataWithDefaults instantiates a new PaymentCallbackData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaymentCallbackDataWithDefaults() *PaymentCallbackData { + this := PaymentCallbackData{} + return &this +} + +// GetId returns the Id field value +func (o *PaymentCallbackData) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PaymentCallbackData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PaymentCallbackData) SetId(v string) { + o.Id = v +} + +// GetPaymentRequestId returns the PaymentRequestId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentCallbackData) GetPaymentRequestId() string { + if o == nil || utils.IsNil(o.PaymentRequestId.Get()) { + var ret string + return ret + } + return *o.PaymentRequestId.Get() +} + +// GetPaymentRequestIdOk returns a tuple with the PaymentRequestId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentCallbackData) GetPaymentRequestIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PaymentRequestId.Get(), o.PaymentRequestId.IsSet() +} + +// HasPaymentRequestId returns a boolean if a field has been set. +func (o *PaymentCallbackData) HasPaymentRequestId() bool { + if o != nil && o.PaymentRequestId.IsSet() { + return true + } + + return false +} + +// SetPaymentRequestId gets a reference to the given NullableString and assigns it to the PaymentRequestId field. +func (o *PaymentCallbackData) SetPaymentRequestId(v string) { + o.PaymentRequestId.Set(&v) +} +// SetPaymentRequestIdNil sets the value for PaymentRequestId to be an explicit nil +func (o *PaymentCallbackData) SetPaymentRequestIdNil() { + o.PaymentRequestId.Set(nil) +} + +// UnsetPaymentRequestId ensures that no value is present for PaymentRequestId, not even an explicit nil +func (o *PaymentCallbackData) UnsetPaymentRequestId() { + o.PaymentRequestId.Unset() +} + +// GetReferenceId returns the ReferenceId field value +func (o *PaymentCallbackData) GetReferenceId() string { + if o == nil { + var ret string + return ret + } + + return o.ReferenceId +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value +// and a boolean to check if the value has been set. +func (o *PaymentCallbackData) GetReferenceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ReferenceId, true +} + +// SetReferenceId sets field value +func (o *PaymentCallbackData) SetReferenceId(v string) { + o.ReferenceId = v +} + +// GetCustomerId returns the CustomerId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentCallbackData) GetCustomerId() string { + if o == nil || utils.IsNil(o.CustomerId.Get()) { + var ret string + return ret + } + return *o.CustomerId.Get() +} + +// GetCustomerIdOk returns a tuple with the CustomerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentCallbackData) GetCustomerIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CustomerId.Get(), o.CustomerId.IsSet() +} + +// HasCustomerId returns a boolean if a field has been set. +func (o *PaymentCallbackData) HasCustomerId() bool { + if o != nil && o.CustomerId.IsSet() { + return true + } + + return false +} + +// SetCustomerId gets a reference to the given NullableString and assigns it to the CustomerId field. +func (o *PaymentCallbackData) SetCustomerId(v string) { + o.CustomerId.Set(&v) +} +// SetCustomerIdNil sets the value for CustomerId to be an explicit nil +func (o *PaymentCallbackData) SetCustomerIdNil() { + o.CustomerId.Set(nil) +} + +// UnsetCustomerId ensures that no value is present for CustomerId, not even an explicit nil +func (o *PaymentCallbackData) UnsetCustomerId() { + o.CustomerId.Unset() +} + +// GetCurrency returns the Currency field value +func (o *PaymentCallbackData) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *PaymentCallbackData) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *PaymentCallbackData) SetCurrency(v string) { + o.Currency = v +} + +// GetAmount returns the Amount field value +func (o *PaymentCallbackData) GetAmount() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *PaymentCallbackData) GetAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *PaymentCallbackData) SetAmount(v float64) { + o.Amount = v +} + +// GetCountry returns the Country field value +func (o *PaymentCallbackData) GetCountry() string { + if o == nil { + var ret string + return ret + } + + return o.Country +} + +// GetCountryOk returns a tuple with the Country field value +// and a boolean to check if the value has been set. +func (o *PaymentCallbackData) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Country, true +} + +// SetCountry sets field value +func (o *PaymentCallbackData) SetCountry(v string) { + o.Country = v +} + +// GetStatus returns the Status field value +func (o *PaymentCallbackData) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *PaymentCallbackData) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *PaymentCallbackData) SetStatus(v string) { + o.Status = v +} + +// GetPaymentMethod returns the PaymentMethod field value +func (o *PaymentCallbackData) GetPaymentMethod() PaymentMethod { + if o == nil { + var ret PaymentMethod + return ret + } + + return o.PaymentMethod +} + +// GetPaymentMethodOk returns a tuple with the PaymentMethod field value +// and a boolean to check if the value has been set. +func (o *PaymentCallbackData) GetPaymentMethodOk() (*PaymentMethod, bool) { + if o == nil { + return nil, false + } + return &o.PaymentMethod, true +} + +// SetPaymentMethod sets field value +func (o *PaymentCallbackData) SetPaymentMethod(v PaymentMethod) { + o.PaymentMethod = v +} + +// GetChannelProperties returns the ChannelProperties field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentCallbackData) GetChannelProperties() PaymentRequestChannelProperties { + if o == nil || utils.IsNil(o.ChannelProperties.Get()) { + var ret PaymentRequestChannelProperties + return ret + } + return *o.ChannelProperties.Get() +} + +// GetChannelPropertiesOk returns a tuple with the ChannelProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentCallbackData) GetChannelPropertiesOk() (*PaymentRequestChannelProperties, bool) { + if o == nil { + return nil, false + } + return o.ChannelProperties.Get(), o.ChannelProperties.IsSet() +} + +// HasChannelProperties returns a boolean if a field has been set. +func (o *PaymentCallbackData) HasChannelProperties() bool { + if o != nil && o.ChannelProperties.IsSet() { + return true + } + + return false +} + +// SetChannelProperties gets a reference to the given NullablePaymentRequestChannelProperties and assigns it to the ChannelProperties field. +func (o *PaymentCallbackData) SetChannelProperties(v PaymentRequestChannelProperties) { + o.ChannelProperties.Set(&v) +} +// SetChannelPropertiesNil sets the value for ChannelProperties to be an explicit nil +func (o *PaymentCallbackData) SetChannelPropertiesNil() { + o.ChannelProperties.Set(nil) +} + +// UnsetChannelProperties ensures that no value is present for ChannelProperties, not even an explicit nil +func (o *PaymentCallbackData) UnsetChannelProperties() { + o.ChannelProperties.Unset() +} + +// GetPaymentDetail returns the PaymentDetail field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentCallbackData) GetPaymentDetail() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.PaymentDetail +} + +// GetPaymentDetailOk returns a tuple with the PaymentDetail field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentCallbackData) GetPaymentDetailOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.PaymentDetail) { + return map[string]interface{}{}, false + } + return o.PaymentDetail, true +} + +// HasPaymentDetail returns a boolean if a field has been set. +func (o *PaymentCallbackData) HasPaymentDetail() bool { + if o != nil && utils.IsNil(o.PaymentDetail) { + return true + } + + return false +} + +// SetPaymentDetail gets a reference to the given map[string]interface{} and assigns it to the PaymentDetail field. +func (o *PaymentCallbackData) SetPaymentDetail(v map[string]interface{}) { + o.PaymentDetail = v +} + +// GetFailureCode returns the FailureCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentCallbackData) GetFailureCode() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.FailureCode +} + +// GetFailureCodeOk returns a tuple with the FailureCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentCallbackData) GetFailureCodeOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.FailureCode) { + return map[string]interface{}{}, false + } + return o.FailureCode, true +} + +// HasFailureCode returns a boolean if a field has been set. +func (o *PaymentCallbackData) HasFailureCode() bool { + if o != nil && utils.IsNil(o.FailureCode) { + return true + } + + return false +} + +// SetFailureCode gets a reference to the given map[string]interface{} and assigns it to the FailureCode field. +func (o *PaymentCallbackData) SetFailureCode(v map[string]interface{}) { + o.FailureCode = v +} + +// GetCreated returns the Created field value +func (o *PaymentCallbackData) GetCreated() string { + if o == nil { + var ret string + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *PaymentCallbackData) GetCreatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *PaymentCallbackData) SetCreated(v string) { + o.Created = v +} + +// GetUpdated returns the Updated field value +func (o *PaymentCallbackData) GetUpdated() string { + if o == nil { + var ret string + return ret + } + + return o.Updated +} + +// GetUpdatedOk returns a tuple with the Updated field value +// and a boolean to check if the value has been set. +func (o *PaymentCallbackData) GetUpdatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Updated, true +} + +// SetUpdated sets field value +func (o *PaymentCallbackData) SetUpdated(v string) { + o.Updated = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PaymentCallbackData) GetMetadata() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PaymentCallbackData) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *PaymentCallbackData) HasMetadata() bool { + if o != nil && utils.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *PaymentCallbackData) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +func (o PaymentCallbackData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaymentCallbackData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if o.PaymentRequestId.IsSet() { + toSerialize["payment_request_id"] = o.PaymentRequestId.Get() + } + toSerialize["reference_id"] = o.ReferenceId + if o.CustomerId.IsSet() { + toSerialize["customer_id"] = o.CustomerId.Get() + } + toSerialize["currency"] = o.Currency + toSerialize["amount"] = o.Amount + toSerialize["country"] = o.Country + toSerialize["status"] = o.Status + toSerialize["payment_method"] = o.PaymentMethod + if o.ChannelProperties.IsSet() { + toSerialize["channel_properties"] = o.ChannelProperties.Get() + } + if o.PaymentDetail != nil { + toSerialize["payment_detail"] = o.PaymentDetail + } + if o.FailureCode != nil { + toSerialize["failure_code"] = o.FailureCode + } + toSerialize["created"] = o.Created + toSerialize["updated"] = o.Updated + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + return toSerialize, nil +} + +type NullablePaymentCallbackData struct { + value *PaymentCallbackData + isSet bool +} + +func (v NullablePaymentCallbackData) Get() *PaymentCallbackData { + return v.value +} + +func (v *NullablePaymentCallbackData) Set(val *PaymentCallbackData) { + v.value = val + v.isSet = true +} + +func (v NullablePaymentCallbackData) IsSet() bool { + return v.isSet +} + +func (v *NullablePaymentCallbackData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaymentCallbackData(val *PaymentCallbackData) *NullablePaymentCallbackData { + return &NullablePaymentCallbackData{value: val, isSet: true} +} + +func (v NullablePaymentCallbackData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaymentCallbackData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/payment_request/model_payment_method.go b/payment_request/model_payment_method.go index d982587d..f0a387fc 100644 --- a/payment_request/model_payment_method.go +++ b/payment_request/model_payment_method.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_method_parameters.go b/payment_request/model_payment_method_parameters.go index 1611fefa..0fa6b33e 100644 --- a/payment_request/model_payment_method_parameters.go +++ b/payment_request/model_payment_method_parameters.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_method_reusability.go b/payment_request/model_payment_method_reusability.go index 9b6ae93c..aec2b1fc 100644 --- a/payment_request/model_payment_method_reusability.go +++ b/payment_request/model_payment_method_reusability.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_method_status.go b/payment_request/model_payment_method_status.go index 56551569..d63251b2 100644 --- a/payment_request/model_payment_method_status.go +++ b/payment_request/model_payment_method_status.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_method_type.go b/payment_request/model_payment_method_type.go index 08ed3712..708a4cc7 100644 --- a/payment_request/model_payment_method_type.go +++ b/payment_request/model_payment_method_type.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request.go b/payment_request/model_payment_request.go index 4e8a4c92..b50d7bf1 100644 --- a/payment_request/model_payment_request.go +++ b/payment_request/model_payment_request.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request_action.go b/payment_request/model_payment_request_action.go index 98ce302a..d5c838b7 100644 --- a/payment_request/model_payment_request_action.go +++ b/payment_request/model_payment_request_action.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request_auth_parameters.go b/payment_request/model_payment_request_auth_parameters.go index cc6d7dd9..12e75f75 100644 --- a/payment_request/model_payment_request_auth_parameters.go +++ b/payment_request/model_payment_request_auth_parameters.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request_basket_item.go b/payment_request/model_payment_request_basket_item.go index 5cb982c8..44ab8813 100644 --- a/payment_request/model_payment_request_basket_item.go +++ b/payment_request/model_payment_request_basket_item.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request_capture_method.go b/payment_request/model_payment_request_capture_method.go index 26d64694..3d3edc19 100644 --- a/payment_request/model_payment_request_capture_method.go +++ b/payment_request/model_payment_request_capture_method.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request_card_verification_results.go b/payment_request/model_payment_request_card_verification_results.go index eb8324af..6e36f919 100644 --- a/payment_request/model_payment_request_card_verification_results.go +++ b/payment_request/model_payment_request_card_verification_results.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request_card_verification_results_three_dee_secure.go b/payment_request/model_payment_request_card_verification_results_three_dee_secure.go index 2ebf1267..3aa1ff9b 100644 --- a/payment_request/model_payment_request_card_verification_results_three_dee_secure.go +++ b/payment_request/model_payment_request_card_verification_results_three_dee_secure.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request_channel_properties.go b/payment_request/model_payment_request_channel_properties.go index ed1f18de..ce71c6ea 100644 --- a/payment_request/model_payment_request_channel_properties.go +++ b/payment_request/model_payment_request_channel_properties.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request_country.go b/payment_request/model_payment_request_country.go index 7cf177d9..6aa6d865 100644 --- a/payment_request/model_payment_request_country.go +++ b/payment_request/model_payment_request_country.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request_currency.go b/payment_request/model_payment_request_currency.go index 64c66440..5f123d85 100644 --- a/payment_request/model_payment_request_currency.go +++ b/payment_request/model_payment_request_currency.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request_initiator.go b/payment_request/model_payment_request_initiator.go index 38d730d0..6da25648 100644 --- a/payment_request/model_payment_request_initiator.go +++ b/payment_request/model_payment_request_initiator.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request_list_response.go b/payment_request/model_payment_request_list_response.go index af7c06ea..91694a02 100644 --- a/payment_request/model_payment_request_list_response.go +++ b/payment_request/model_payment_request_list_response.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request_parameters.go b/payment_request/model_payment_request_parameters.go index 00c83097..e7ee154d 100644 --- a/payment_request/model_payment_request_parameters.go +++ b/payment_request/model_payment_request_parameters.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request_parameters_channel_properties.go b/payment_request/model_payment_request_parameters_channel_properties.go index 25f15ebe..ebdfc092 100644 --- a/payment_request/model_payment_request_parameters_channel_properties.go +++ b/payment_request/model_payment_request_parameters_channel_properties.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request_parameters_channel_properties_all_of.go b/payment_request/model_payment_request_parameters_channel_properties_all_of.go index a30d9125..96921237 100644 --- a/payment_request/model_payment_request_parameters_channel_properties_all_of.go +++ b/payment_request/model_payment_request_parameters_channel_properties_all_of.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request_shipping_information.go b/payment_request/model_payment_request_shipping_information.go index 20ac023f..07671565 100644 --- a/payment_request/model_payment_request_shipping_information.go +++ b/payment_request/model_payment_request_shipping_information.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_payment_request_status.go b/payment_request/model_payment_request_status.go index 28f9a80f..64391522 100644 --- a/payment_request/model_payment_request_status.go +++ b/payment_request/model_payment_request_status.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_qr_code.go b/payment_request/model_qr_code.go index 78b7a071..33c4a4fa 100644 --- a/payment_request/model_qr_code.go +++ b/payment_request/model_qr_code.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_qr_code_channel_code.go b/payment_request/model_qr_code_channel_code.go index 6255ce8e..84ee19c0 100644 --- a/payment_request/model_qr_code_channel_code.go +++ b/payment_request/model_qr_code_channel_code.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_qr_code_channel_properties.go b/payment_request/model_qr_code_channel_properties.go index 6051d2ee..c4303bb5 100644 --- a/payment_request/model_qr_code_channel_properties.go +++ b/payment_request/model_qr_code_channel_properties.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_qr_code_parameters.go b/payment_request/model_qr_code_parameters.go index bbe4f08e..2dc8c7df 100644 --- a/payment_request/model_qr_code_parameters.go +++ b/payment_request/model_qr_code_parameters.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_virtual_account.go b/payment_request/model_virtual_account.go index 9424a285..b5e366b2 100644 --- a/payment_request/model_virtual_account.go +++ b/payment_request/model_virtual_account.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_virtual_account_all_of.go b/payment_request/model_virtual_account_all_of.go index d4da2434..a0ae1d7f 100644 --- a/payment_request/model_virtual_account_all_of.go +++ b/payment_request/model_virtual_account_all_of.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_virtual_account_alternative_display.go b/payment_request/model_virtual_account_alternative_display.go index 9cbc45f6..3dfb15c6 100644 --- a/payment_request/model_virtual_account_alternative_display.go +++ b/payment_request/model_virtual_account_alternative_display.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_virtual_account_channel_code.go b/payment_request/model_virtual_account_channel_code.go index ecd9da9e..189670ae 100644 --- a/payment_request/model_virtual_account_channel_code.go +++ b/payment_request/model_virtual_account_channel_code.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_virtual_account_channel_properties.go b/payment_request/model_virtual_account_channel_properties.go index 53d395c1..bb472319 100644 --- a/payment_request/model_virtual_account_channel_properties.go +++ b/payment_request/model_virtual_account_channel_properties.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/payment_request/model_virtual_account_parameters.go b/payment_request/model_virtual_account_parameters.go index ef396926..10ddbc26 100644 --- a/payment_request/model_virtual_account_parameters.go +++ b/payment_request/model_virtual_account_parameters.go @@ -3,7 +3,7 @@ Payment Requests This API is used for Payment Requests -API version: 1.45.1 +API version: 1.45.2 */ diff --git a/refund/model_create_refund.go b/refund/model_create_refund.go index 3a054224..7981937d 100644 --- a/refund/model_create_refund.go +++ b/refund/model_create_refund.go @@ -3,7 +3,7 @@ Refund Service This API is used for the unified refund service -API version: 1.3.3 +API version: 1.3.4 */ diff --git a/refund/model_create_refund_400_response.go b/refund/model_create_refund_400_response.go index 4105a90a..2249754d 100644 --- a/refund/model_create_refund_400_response.go +++ b/refund/model_create_refund_400_response.go @@ -3,7 +3,7 @@ Refund Service This API is used for the unified refund service -API version: 1.3.3 +API version: 1.3.4 */ diff --git a/refund/model_create_refund_403_response.go b/refund/model_create_refund_403_response.go index abef9549..38bfdcfc 100644 --- a/refund/model_create_refund_403_response.go +++ b/refund/model_create_refund_403_response.go @@ -3,7 +3,7 @@ Refund Service This API is used for the unified refund service -API version: 1.3.3 +API version: 1.3.4 */ diff --git a/refund/model_create_refund_404_response.go b/refund/model_create_refund_404_response.go index 1e91da34..c7f62035 100644 --- a/refund/model_create_refund_404_response.go +++ b/refund/model_create_refund_404_response.go @@ -3,7 +3,7 @@ Refund Service This API is used for the unified refund service -API version: 1.3.3 +API version: 1.3.4 */ diff --git a/refund/model_create_refund_409_response.go b/refund/model_create_refund_409_response.go index f7e11f5d..e349aaf9 100644 --- a/refund/model_create_refund_409_response.go +++ b/refund/model_create_refund_409_response.go @@ -3,7 +3,7 @@ Refund Service This API is used for the unified refund service -API version: 1.3.3 +API version: 1.3.4 */ diff --git a/refund/model_create_refund_503_response.go b/refund/model_create_refund_503_response.go index 2dd125fe..e033b839 100644 --- a/refund/model_create_refund_503_response.go +++ b/refund/model_create_refund_503_response.go @@ -3,7 +3,7 @@ Refund Service This API is used for the unified refund service -API version: 1.3.3 +API version: 1.3.4 */ diff --git a/refund/model_get_all_refunds_default_response.go b/refund/model_get_all_refunds_default_response.go index 4a0664d6..aab3c381 100644 --- a/refund/model_get_all_refunds_default_response.go +++ b/refund/model_get_all_refunds_default_response.go @@ -3,7 +3,7 @@ Refund Service This API is used for the unified refund service -API version: 1.3.3 +API version: 1.3.4 */ diff --git a/refund/model_refund.go b/refund/model_refund.go index bfc265b5..00a2d603 100644 --- a/refund/model_refund.go +++ b/refund/model_refund.go @@ -3,7 +3,7 @@ Refund Service This API is used for the unified refund service -API version: 1.3.3 +API version: 1.3.4 */ diff --git a/refund/model_refund_callback.go b/refund/model_refund_callback.go new file mode 100644 index 00000000..0827339e --- /dev/null +++ b/refund/model_refund_callback.go @@ -0,0 +1,210 @@ +/* +Refund Service + +This API is used for the unified refund service + +API version: 1.3.4 +*/ + + +package refund + +import ( + "encoding/json" + + utils "github.com/xendit/xendit-go/v3/utils" +) + +// checks if the RefundCallback type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &RefundCallback{} + +// RefundCallback Callback for successful or failed Refunds made via the Payments API +type RefundCallback struct { + // Identifies the event that triggered a notification to the merchant + Event string `json:"event"` + // business_id + BusinessId string `json:"business_id"` + Created string `json:"created"` + Data *RefundCallbackData `json:"data,omitempty"` +} + +// NewRefundCallback instantiates a new RefundCallback object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRefundCallback(event string, businessId string, created string) *RefundCallback { + this := RefundCallback{} + this.Event = event + this.BusinessId = businessId + this.Created = created + return &this +} + +// NewRefundCallbackWithDefaults instantiates a new RefundCallback object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRefundCallbackWithDefaults() *RefundCallback { + this := RefundCallback{} + return &this +} + +// GetEvent returns the Event field value +func (o *RefundCallback) GetEvent() string { + if o == nil { + var ret string + return ret + } + + return o.Event +} + +// GetEventOk returns a tuple with the Event field value +// and a boolean to check if the value has been set. +func (o *RefundCallback) GetEventOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Event, true +} + +// SetEvent sets field value +func (o *RefundCallback) SetEvent(v string) { + o.Event = v +} + +// GetBusinessId returns the BusinessId field value +func (o *RefundCallback) GetBusinessId() string { + if o == nil { + var ret string + return ret + } + + return o.BusinessId +} + +// GetBusinessIdOk returns a tuple with the BusinessId field value +// and a boolean to check if the value has been set. +func (o *RefundCallback) GetBusinessIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BusinessId, true +} + +// SetBusinessId sets field value +func (o *RefundCallback) SetBusinessId(v string) { + o.BusinessId = v +} + +// GetCreated returns the Created field value +func (o *RefundCallback) GetCreated() string { + if o == nil { + var ret string + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *RefundCallback) GetCreatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *RefundCallback) SetCreated(v string) { + o.Created = v +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *RefundCallback) GetData() RefundCallbackData { + if o == nil || utils.IsNil(o.Data) { + var ret RefundCallbackData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RefundCallback) GetDataOk() (*RefundCallbackData, bool) { + if o == nil || utils.IsNil(o.Data) { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *RefundCallback) HasData() bool { + if o != nil && !utils.IsNil(o.Data) { + return true + } + + return false +} + +// SetData gets a reference to the given RefundCallbackData and assigns it to the Data field. +func (o *RefundCallback) SetData(v RefundCallbackData) { + o.Data = &v +} + +func (o RefundCallback) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RefundCallback) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["event"] = o.Event + toSerialize["business_id"] = o.BusinessId + toSerialize["created"] = o.Created + if !utils.IsNil(o.Data) { + toSerialize["data"] = o.Data + } + return toSerialize, nil +} + +type NullableRefundCallback struct { + value *RefundCallback + isSet bool +} + +func (v NullableRefundCallback) Get() *RefundCallback { + return v.value +} + +func (v *NullableRefundCallback) Set(val *RefundCallback) { + v.value = val + v.isSet = true +} + +func (v NullableRefundCallback) IsSet() bool { + return v.isSet +} + +func (v *NullableRefundCallback) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRefundCallback(val *RefundCallback) *NullableRefundCallback { + return &NullableRefundCallback{value: val, isSet: true} +} + +func (v NullableRefundCallback) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRefundCallback) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/refund/model_refund_callback_data.go b/refund/model_refund_callback_data.go new file mode 100644 index 00000000..a7b96cd0 --- /dev/null +++ b/refund/model_refund_callback_data.go @@ -0,0 +1,609 @@ +/* +Refund Service + +This API is used for the unified refund service + +API version: 1.3.4 +*/ + + +package refund + +import ( + "encoding/json" + + utils "github.com/xendit/xendit-go/v3/utils" +) + +// checks if the RefundCallbackData type satisfies the MappedNullable interface at compile time +var _ utils.MappedNullable = &RefundCallbackData{} + +// RefundCallbackData struct for RefundCallbackData +type RefundCallbackData struct { + Id string `json:"id"` + PaymentRequestId string `json:"payment_request_id"` + InvoiceId NullableString `json:"invoice_id,omitempty"` + PaymentMethodType string `json:"payment_method_type"` + Amount float64 `json:"amount"` + ChannelCode string `json:"channel_code"` + Status string `json:"status"` + Reason string `json:"reason"` + Country string `json:"country"` + Currency string `json:"currency"` + ReferenceId NullableString `json:"reference_id,omitempty"` + FailureCode NullableString `json:"failure_code,omitempty"` + RefundFeeAmount NullableFloat64 `json:"refund_fee_amount,omitempty"` + Created string `json:"created"` + Updated string `json:"updated"` + Metadata map[string]interface{} `json:"metadata,omitempty"` +} + +// NewRefundCallbackData instantiates a new RefundCallbackData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRefundCallbackData(id string, paymentRequestId string, paymentMethodType string, amount float64, channelCode string, status string, reason string, country string, currency string, created string, updated string) *RefundCallbackData { + this := RefundCallbackData{} + this.Id = id + this.PaymentRequestId = paymentRequestId + this.PaymentMethodType = paymentMethodType + this.Amount = amount + this.ChannelCode = channelCode + this.Status = status + this.Reason = reason + this.Country = country + this.Currency = currency + this.Created = created + this.Updated = updated + return &this +} + +// NewRefundCallbackDataWithDefaults instantiates a new RefundCallbackData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRefundCallbackDataWithDefaults() *RefundCallbackData { + this := RefundCallbackData{} + return &this +} + +// GetId returns the Id field value +func (o *RefundCallbackData) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RefundCallbackData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RefundCallbackData) SetId(v string) { + o.Id = v +} + +// GetPaymentRequestId returns the PaymentRequestId field value +func (o *RefundCallbackData) GetPaymentRequestId() string { + if o == nil { + var ret string + return ret + } + + return o.PaymentRequestId +} + +// GetPaymentRequestIdOk returns a tuple with the PaymentRequestId field value +// and a boolean to check if the value has been set. +func (o *RefundCallbackData) GetPaymentRequestIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PaymentRequestId, true +} + +// SetPaymentRequestId sets field value +func (o *RefundCallbackData) SetPaymentRequestId(v string) { + o.PaymentRequestId = v +} + +// GetInvoiceId returns the InvoiceId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RefundCallbackData) GetInvoiceId() string { + if o == nil || utils.IsNil(o.InvoiceId.Get()) { + var ret string + return ret + } + return *o.InvoiceId.Get() +} + +// GetInvoiceIdOk returns a tuple with the InvoiceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RefundCallbackData) GetInvoiceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.InvoiceId.Get(), o.InvoiceId.IsSet() +} + +// HasInvoiceId returns a boolean if a field has been set. +func (o *RefundCallbackData) HasInvoiceId() bool { + if o != nil && o.InvoiceId.IsSet() { + return true + } + + return false +} + +// SetInvoiceId gets a reference to the given NullableString and assigns it to the InvoiceId field. +func (o *RefundCallbackData) SetInvoiceId(v string) { + o.InvoiceId.Set(&v) +} +// SetInvoiceIdNil sets the value for InvoiceId to be an explicit nil +func (o *RefundCallbackData) SetInvoiceIdNil() { + o.InvoiceId.Set(nil) +} + +// UnsetInvoiceId ensures that no value is present for InvoiceId, not even an explicit nil +func (o *RefundCallbackData) UnsetInvoiceId() { + o.InvoiceId.Unset() +} + +// GetPaymentMethodType returns the PaymentMethodType field value +func (o *RefundCallbackData) GetPaymentMethodType() string { + if o == nil { + var ret string + return ret + } + + return o.PaymentMethodType +} + +// GetPaymentMethodTypeOk returns a tuple with the PaymentMethodType field value +// and a boolean to check if the value has been set. +func (o *RefundCallbackData) GetPaymentMethodTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PaymentMethodType, true +} + +// SetPaymentMethodType sets field value +func (o *RefundCallbackData) SetPaymentMethodType(v string) { + o.PaymentMethodType = v +} + +// GetAmount returns the Amount field value +func (o *RefundCallbackData) GetAmount() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.Amount +} + +// GetAmountOk returns a tuple with the Amount field value +// and a boolean to check if the value has been set. +func (o *RefundCallbackData) GetAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.Amount, true +} + +// SetAmount sets field value +func (o *RefundCallbackData) SetAmount(v float64) { + o.Amount = v +} + +// GetChannelCode returns the ChannelCode field value +func (o *RefundCallbackData) GetChannelCode() string { + if o == nil { + var ret string + return ret + } + + return o.ChannelCode +} + +// GetChannelCodeOk returns a tuple with the ChannelCode field value +// and a boolean to check if the value has been set. +func (o *RefundCallbackData) GetChannelCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ChannelCode, true +} + +// SetChannelCode sets field value +func (o *RefundCallbackData) SetChannelCode(v string) { + o.ChannelCode = v +} + +// GetStatus returns the Status field value +func (o *RefundCallbackData) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *RefundCallbackData) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *RefundCallbackData) SetStatus(v string) { + o.Status = v +} + +// GetReason returns the Reason field value +func (o *RefundCallbackData) GetReason() string { + if o == nil { + var ret string + return ret + } + + return o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value +// and a boolean to check if the value has been set. +func (o *RefundCallbackData) GetReasonOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Reason, true +} + +// SetReason sets field value +func (o *RefundCallbackData) SetReason(v string) { + o.Reason = v +} + +// GetCountry returns the Country field value +func (o *RefundCallbackData) GetCountry() string { + if o == nil { + var ret string + return ret + } + + return o.Country +} + +// GetCountryOk returns a tuple with the Country field value +// and a boolean to check if the value has been set. +func (o *RefundCallbackData) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Country, true +} + +// SetCountry sets field value +func (o *RefundCallbackData) SetCountry(v string) { + o.Country = v +} + +// GetCurrency returns the Currency field value +func (o *RefundCallbackData) GetCurrency() string { + if o == nil { + var ret string + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *RefundCallbackData) GetCurrencyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *RefundCallbackData) SetCurrency(v string) { + o.Currency = v +} + +// GetReferenceId returns the ReferenceId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RefundCallbackData) GetReferenceId() string { + if o == nil || utils.IsNil(o.ReferenceId.Get()) { + var ret string + return ret + } + return *o.ReferenceId.Get() +} + +// GetReferenceIdOk returns a tuple with the ReferenceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RefundCallbackData) GetReferenceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ReferenceId.Get(), o.ReferenceId.IsSet() +} + +// HasReferenceId returns a boolean if a field has been set. +func (o *RefundCallbackData) HasReferenceId() bool { + if o != nil && o.ReferenceId.IsSet() { + return true + } + + return false +} + +// SetReferenceId gets a reference to the given NullableString and assigns it to the ReferenceId field. +func (o *RefundCallbackData) SetReferenceId(v string) { + o.ReferenceId.Set(&v) +} +// SetReferenceIdNil sets the value for ReferenceId to be an explicit nil +func (o *RefundCallbackData) SetReferenceIdNil() { + o.ReferenceId.Set(nil) +} + +// UnsetReferenceId ensures that no value is present for ReferenceId, not even an explicit nil +func (o *RefundCallbackData) UnsetReferenceId() { + o.ReferenceId.Unset() +} + +// GetFailureCode returns the FailureCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RefundCallbackData) GetFailureCode() string { + if o == nil || utils.IsNil(o.FailureCode.Get()) { + var ret string + return ret + } + return *o.FailureCode.Get() +} + +// GetFailureCodeOk returns a tuple with the FailureCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RefundCallbackData) GetFailureCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FailureCode.Get(), o.FailureCode.IsSet() +} + +// HasFailureCode returns a boolean if a field has been set. +func (o *RefundCallbackData) HasFailureCode() bool { + if o != nil && o.FailureCode.IsSet() { + return true + } + + return false +} + +// SetFailureCode gets a reference to the given NullableString and assigns it to the FailureCode field. +func (o *RefundCallbackData) SetFailureCode(v string) { + o.FailureCode.Set(&v) +} +// SetFailureCodeNil sets the value for FailureCode to be an explicit nil +func (o *RefundCallbackData) SetFailureCodeNil() { + o.FailureCode.Set(nil) +} + +// UnsetFailureCode ensures that no value is present for FailureCode, not even an explicit nil +func (o *RefundCallbackData) UnsetFailureCode() { + o.FailureCode.Unset() +} + +// GetRefundFeeAmount returns the RefundFeeAmount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RefundCallbackData) GetRefundFeeAmount() float64 { + if o == nil || utils.IsNil(o.RefundFeeAmount.Get()) { + var ret float64 + return ret + } + return *o.RefundFeeAmount.Get() +} + +// GetRefundFeeAmountOk returns a tuple with the RefundFeeAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RefundCallbackData) GetRefundFeeAmountOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.RefundFeeAmount.Get(), o.RefundFeeAmount.IsSet() +} + +// HasRefundFeeAmount returns a boolean if a field has been set. +func (o *RefundCallbackData) HasRefundFeeAmount() bool { + if o != nil && o.RefundFeeAmount.IsSet() { + return true + } + + return false +} + +// SetRefundFeeAmount gets a reference to the given NullableFloat64 and assigns it to the RefundFeeAmount field. +func (o *RefundCallbackData) SetRefundFeeAmount(v float64) { + o.RefundFeeAmount.Set(&v) +} +// SetRefundFeeAmountNil sets the value for RefundFeeAmount to be an explicit nil +func (o *RefundCallbackData) SetRefundFeeAmountNil() { + o.RefundFeeAmount.Set(nil) +} + +// UnsetRefundFeeAmount ensures that no value is present for RefundFeeAmount, not even an explicit nil +func (o *RefundCallbackData) UnsetRefundFeeAmount() { + o.RefundFeeAmount.Unset() +} + +// GetCreated returns the Created field value +func (o *RefundCallbackData) GetCreated() string { + if o == nil { + var ret string + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *RefundCallbackData) GetCreatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *RefundCallbackData) SetCreated(v string) { + o.Created = v +} + +// GetUpdated returns the Updated field value +func (o *RefundCallbackData) GetUpdated() string { + if o == nil { + var ret string + return ret + } + + return o.Updated +} + +// GetUpdatedOk returns a tuple with the Updated field value +// and a boolean to check if the value has been set. +func (o *RefundCallbackData) GetUpdatedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Updated, true +} + +// SetUpdated sets field value +func (o *RefundCallbackData) SetUpdated(v string) { + o.Updated = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RefundCallbackData) GetMetadata() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RefundCallbackData) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || utils.IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *RefundCallbackData) HasMetadata() bool { + if o != nil && utils.IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *RefundCallbackData) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +func (o RefundCallbackData) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RefundCallbackData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["payment_request_id"] = o.PaymentRequestId + if o.InvoiceId.IsSet() { + toSerialize["invoice_id"] = o.InvoiceId.Get() + } + toSerialize["payment_method_type"] = o.PaymentMethodType + toSerialize["amount"] = o.Amount + toSerialize["channel_code"] = o.ChannelCode + toSerialize["status"] = o.Status + toSerialize["reason"] = o.Reason + toSerialize["country"] = o.Country + toSerialize["currency"] = o.Currency + if o.ReferenceId.IsSet() { + toSerialize["reference_id"] = o.ReferenceId.Get() + } + if o.FailureCode.IsSet() { + toSerialize["failure_code"] = o.FailureCode.Get() + } + if o.RefundFeeAmount.IsSet() { + toSerialize["refund_fee_amount"] = o.RefundFeeAmount.Get() + } + toSerialize["created"] = o.Created + toSerialize["updated"] = o.Updated + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + return toSerialize, nil +} + +type NullableRefundCallbackData struct { + value *RefundCallbackData + isSet bool +} + +func (v NullableRefundCallbackData) Get() *RefundCallbackData { + return v.value +} + +func (v *NullableRefundCallbackData) Set(val *RefundCallbackData) { + v.value = val + v.isSet = true +} + +func (v NullableRefundCallbackData) IsSet() bool { + return v.isSet +} + +func (v *NullableRefundCallbackData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRefundCallbackData(val *RefundCallbackData) *NullableRefundCallbackData { + return &NullableRefundCallbackData{value: val, isSet: true} +} + +func (v NullableRefundCallbackData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRefundCallbackData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/refund/model_refund_list.go b/refund/model_refund_list.go index 59c938f9..1dba9c68 100644 --- a/refund/model_refund_list.go +++ b/refund/model_refund_list.go @@ -3,7 +3,7 @@ Refund Service This API is used for the unified refund service -API version: 1.3.3 +API version: 1.3.4 */