Skip to content

Commit

Permalink
Add readme
Browse files Browse the repository at this point in the history
Add examples and images
  • Loading branch information
adrianplacetopay committed Oct 23, 2023
1 parent a256268 commit 8d84c4b
Show file tree
Hide file tree
Showing 12 changed files with 1,213 additions and 2 deletions.
496 changes: 496 additions & 0 deletions README-es.md

Large diffs are not rendered by default.

504 changes: 504 additions & 0 deletions README.md

Large diffs are not rendered by default.

70 changes: 70 additions & 0 deletions examples/basic_payment_request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"auth": {
"login": "c51ce410c124a10e0db5e4b97fc2af39",
"nonce": "NjE0OWVkODgwYjNhNw==",
"seed": "2023-10-17T17:13-0500",
"tranKey": "VQOcRcVH2DfL6Y4B4SaK6yhoH/VOUveZ3xT16OQnvxE="
},
"cancelUrl": "redirection://receipt?cancel",
"captureAddress": false,
"expiration": "2023-10-17T23:13-0500",
"ipAddress": "10.0.2.15",
"locale": "es_CO",
"noBuyerFill": false,
"payment": {
"allowPartial": false,
"amount": {
"currency": "COP",
"details": [
{
"amount": 15000.0,
"kind": "shipping"
},
{
"amount": 150000.0,
"kind": "subtotal"
}
],
"total": 165000.0
},
"buyer": {
"address": {
"city": "Cali",
"country": "CO",
"phone": "+5722222222",
"postalCode": "660066",
"state": "Valle del Cauca",
"street": "Avenida 789"
},
"document": "5555555555",
"documentType": "CC",
"email": "[email protected]",
"mobile": "+573005555555",
"name": "Pedro",
"surname": "López"
},
"description": "Listing of products with values from 35k to 80k for a single unit and 19% tax.",
"items": [
{
"category": "Books",
"name": "Libro antiguo",
"price": 80000,
"qty": 1,
"sku": 302,
"tax": 15200.0
},
{
"category": "Clothes",
"name": "Camisa desconocida",
"price": 35000,
"qty": 2,
"sku": 102,
"tax": 6650.0
}
],
"reference": "3"
},
"returnUrl": "redirection://receipt?return",
"skipResult": false,
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
}
142 changes: 142 additions & 0 deletions examples/information_response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"requestId": 2630139,
"status": {
"status": "APPROVED",
"reason": "00",
"message": "La petición ha sido aprobada exitosamente",
"date": "2023-10-18T15:02:42-05:00"
},
"request": {
"locale": "es_CO",
"payer": {
"document": "1040035001",
"documentType": "CC",
"name": "Karli",
"surname": "Kutch",
"email": "[email protected]",
"mobile": "+573006108300",
"address": {
"postalCode": "123456"
}
},
"payment": {
"reference": "2",
"description": "A single product with a value of 600k for a single unit and zero tax",
"amount": {
"details": [
{
"kind": "shipping",
"amount": 15000
},
{
"kind": "subtotal",
"amount": 50000
}
],
"currency": "COP",
"total": 65000
},
"allowPartial": false,
"items": [
{
"sku": 101,
"name": "Smart Watch",
"category": "Electronic",
"qty": 1,
"price": 50000,
"tax": 9500
}
],
"subscribe": false
},
"fields": [
{
"keyword": "_processUrl_",
"value": "https://checkout-test.placetopay.com/spa/session/2630139/7149a8cf3aed4506669c944ac885978e",
"displayOn": "none"
},
{
"keyword": "_session_",
"value": 2630139,
"displayOn": "none"
}
],
"returnUrl": "redirection://receipt?return",
"ipAddress": "10.0.2.15",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36",
"expiration": "2023-10-18T21:02-0500"
},
"payment": [
{
"amount": {
"to": {
"total": 65000,
"currency": "COP"
},
"from": {
"total": 65000,
"currency": "COP"
},
"factor": 1
},
"status": {
"date": "2023-10-18T15:02:39-05:00",
"reason": "00",
"status": "APPROVED",
"message": "Aprobada"
},
"receipt": "99959359",
"refunded": false,
"franchise": "CR_VS",
"reference": "2",
"issuerName": "JPMORGAN CHASE BANK, N.A.",
"authorization": "000000",
"paymentMethod": "visa",
"processorFields": [
{
"value": "012988341",
"keyword": "merchantCode",
"displayOn": "none"
},
{
"value": "00022645",
"keyword": "terminalNumber",
"displayOn": "none"
},
{
"value": "411111",
"keyword": "bin",
"displayOn": "none"
},
{
"value": "1226",
"keyword": "expiration",
"displayOn": "none"
},
{
"value": 1,
"keyword": "installments",
"displayOn": "none"
},
{
"value": "****1111",
"keyword": "lastDigits",
"displayOn": "none"
},
{
"value": "d3cdf53f1c91cc535c9e459ea09edca5",
"keyword": "id",
"displayOn": "none"
},
{
"value": "000",
"keyword": "b24",
"displayOn": "none"
}
],
"internalReference": 1597013407,
"paymentMethodName": "Visa"
}
],
"subscription": null
}
Binary file added images/environment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/slide_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/slide_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/slide_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/slide_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/slide_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/slide_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions p2pr/Models/Checkout/Payment/CheckoutPaymentRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ struct CheckoutPaymentRequest: Codable, Equatable {
enum CodingKeys: String, CodingKey {
case auth, buyer, cancelUrl, captureAddress, expiration, fields, locale, noBuyerFill, payment, returnUrl, ipAddress, skipResult, userAgent
}

//MARK - change the origin of the credentials

init(package: WelcomePackage, buyer: Buyer, ipAddress: String) {
self.auth = .init(login: ProcessInfo.processInfo.environment[LOGIN_CHECKOUT]!, secretKey: ProcessInfo.processInfo.environment[SECRET_KEY_CHECKOUT]!)
self.buyer = .init(buyer: buyer)
Expand Down

0 comments on commit 8d84c4b

Please sign in to comment.